Saturday, April 18, 2009

Metra-Twitter Service Now Running on Google App Engine

When I first put together my Metra delay service on Twitter, I didn't think it would see a wide audience; I expected myself and maybe a few friends to take advantage of it. I certainly didn't foresee the media attention the feeds generated:

CBS2 Morning Show

Usage quickly spiked after these stories ran -- there are about 1200 people following the Metra feeds at this point. The only problem was that it was running on my personal computer. If I needed to reboot or experienced an internet outage, no updates were posted.

In an effort to make the service more robust, I decided to port to Google App Engine, which allows developers to create applications that run on Google infrastructure. App Engine has been around for about a year, but my Twitter app couldn't run there until a couple weeks ago, when the App Engine team unveiled Scheduled Tasks. This feature allows me to run my regular scans over Metra's delay info, and post the relevant material to Twitter.

All in all, porting to App Engine was a great experience. It's a very straightforward, developer-friendly environment, and I had fun doing it. And now I can turn off my computer again. :P

6 comments:

Andrew said...

thanks for the work. just discovered it today.

Are you scraping the .../Service_Updates/ site? Is this part of the App Engine (the wget, or whatever is used- I am not a coder).

Tony Zale said...

Yes, that's where the delay info comes from. I try to condense the text down to fit the information in as few tweets as possible, but otherwise it's unchanged.

wget is not available within App Engine; I use the provided Python URLFetch library, which provides the same sort of functionality.

ipstenu said...

Any chance you'd open-source your code? I can think of other practical applications but (let's face it) I'm lazy.

Tony Zale said...

Yes, I'm planning on open sourcing the code, I just need to pull some personal information out of it first. As soon as I have time for that cleanup, there will be another posting.

Bob said...

Just found this today. Coffee shop at Lake Cook Road station (MDN line) had an article on you. Thank you for the service.

Joy said...

Thank you!