blogdowntown 89.3 KPCC | Southern California Public Radio

Stay Connected

@blogdowntown on Twitter
blogdowntown on Facebook


Inside the blogdowntown Newsroom

By Eric Richardson
Published: Monday, August 24, 2009, at 08:45PM
bdv4 tour blogdowntown

A botched code upgrade left blogdowntown a bit unstable this morning, causing a pair of brief outages and some issues with commenting.

While all that is long fixed now, I thought I would use the occasion to offer a little glimpse into the application code that powers blogdowntown and the newsroom interface we use to publish stories.

Tech Basics

blogdowntown is a custom application written in Ruby on Rails, and has been since April of 2007. Before that, the site ran on a Perl blogging platform I had written called eThreads.

The code is constantly being updated, but the last ground-up overhaul was to support the redesign we launched on April 1, 2008. That codebase is referred to internally as bdv4.

There are roughly 3000 lines of application code, plus a little over 5000 lines of HTML templates. There are 21 model classes, including Story, StoryLocation, StoryNote, StoryPhoto, StoryRelation, StoryText (we store all revisions, so there are multiple text objects per story) and StoryTopic.

Today's Outage

This morning I hit trouble attempting to deploy a minor set of updates, mostly having to do with managing photo galleries. The code was working internally, but failed to function correctly on the verbdowntown web server.

It took most of the morning to clean up the mess that made, during which time the site was mostly functional.

In the process, though, I did manage to go ahead and move from a mongrel cluster to Phusion Passenger, something that will likely only make sense or be of any interest to those developing Ruby on Rails applications.

Story Flow

A great deal of the bdv4 codebase deals with a part of the site that readers don't even get to see: the newsroom. This is where stories get written, edited and published.

Designed around the way we publish stories, the newsroom interface offers tools for writing, adding photos to a story, linking to past stories, placing a story on a map, and so forth.

One of the cooler features is the ability to add a photo from flickr simply by pasting its URL into the newsroom. The bdv4 code goes out to flickr and queries the information it needs to use the photo. Photos are also automatically cached to Amazon S3 when the story is published so that a flickr outage or slowdown can't take down the site (for the Rails folks -- that process is run in the background via workling / starling).

Each time a story hits a milestone -- it is created, a note is added or its status changes (draft, awaiting edits, published, etc) -- the system sends an email to the story's author(s) and anyone flagged in the system as an editor.

The newsroom also has interfaces for managing headlines (a part of the site Pamela Rouse takes the lead on), topics and users. Editors can see all stories in the system, while authors only see the stories they're credited on. A story can have any number of authors, though I don't know that we've ever included more than a double byline.

The Future

In the near future, updates to the bdv4 code will likely continue to center on improving pieces of the user interface. User accounts are due for a big-time upgrade, with attention being paid to giving users more tools to see what has changed since their last visit.

A larger project is a newsroom tool to support photos not on flickr. It will need to accept a photo upload and automatically generate the five required sizes, uploading them to S3 and storing photo information in the (existing) LocalPhoto database.

I also plan to flesh out geo-features on the site, including geo-search (check out a rough demo here) and stories by neighborhood. The underlying latitude and longitude data is already in the system, so it's just a matter of creating the interfaces on the site.


I'm glad to answer any technical questions people have about how the site works. Just leave a comment or drop me an email.


Tweet This Story || Share on Facebook

Related Topics

Inside blogdowntown

9 stories

Related Stories: