Twitter interface to CTA bus tracker

CTA Bus
CTA Bus photo by seizethedave via Flickr.

About

This is a Twitter (and hopefully, later, a plain old SMS) interface to the CTA Bus Tracker so those of us with simple mobile phones can find out information about our busses.

Ever since I moved to Chicago, I’ve been riding the Chicago Transit Authority (CTA) busses almost every day. I’ve missed my bus more than a few times too. CTA has a Bus Tracker website that works from computers and mobile devices with web browsers (there’s iPhone apps as well), but my phone only does SMS.

This is a work in progress as I’m coding it mostly on the bus on the way to and from work.

Usage

In order to do anything, you have to follow @ctabt.

The best way to show how to use the system is through some examples:

Get help

d ctabt help

Get all stop names and IDs for Eastbound route 77

d ctabt 77 east stops

Get the name for Eastbound route 77 stops at Sheffield

d ctabt 77 east stops shef

Get upcoming busses for a particular stop by name

d ctabt 77 east shef

Get upcoming busses for a particular stop by ID

d ctabt 77 east 9288

You can abbreviate most parts of the commands

d ctabt 77 e s shef

Related Work

  • Implementing this was made possible by Harper Reed’s awesome opening of the Bus Tracker API.
  • CTA Tweet Feed has Twitter/RSS feeds of authoritative and user-generated updates about riding the CTA.

Links

Testament

Testament is a Django-based prison book project management application originally written by Andrew Badr. It lets volunteers track sent and returned packages and inmate requests in the hopes of minimizing delays for inmates and helping the book projects evaluate their services for themselves and funders.  It is used by the Midwest Pages to Prisoners Project and other prison book projects.  I am a contributor to this application’s code and migrated from a pencil and paper on index card database to Testament while coordinating the Midwest Pages to Prisoners Project.

Node body search and replace Drush command

This is a command for the very useful Drupal Shell (Drush) module that lets you search and replace text in the body of a node using regular expressions. I wrote it when I was fixing broken links for the Center for Research Library’s web siter and got tired of having to visit a URL, click the edit link, replace the text, update the revision log, and click the save button.

Install this command as you would any other contributed command (for instance, you could put this file in your ~/.drush folder)

To learn how to use, check out the help text for the command by running drush help replace at the command line.

Example usage:

$ drush –url=http://www.crl.edu replace jstor-titles/economics-titles “/http:\/\/www.crl.edu\/jstortitles\/” “”

This replaces all instances of http://www.crl.edu/jstortitles with an empty string. Note that the syntax and escaping of the regular expressions are for those of PHP’s preg_replace function.

Download replace.drush

Published
Categorized as Code Tagged