Skip to content

Instantly share code, notes, and snippets.

@erikbern
Created March 25, 2016 01:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikbern/0210106c1ab9abacb394 to your computer and use it in GitHub Desktop.
Save erikbern/0210106c1ab9abacb394 to your computer and use it in GitHub Desktop.
from google.transit import gtfs_realtime_pb2
import urllib
for feed_id in [1, 2, 11]:
feed = gtfs_realtime_pb2.FeedMessage()
response = urllib.urlopen('http://datamine.mta.info/mta_esi.php?key=%s&feed_id=%d' % (os.environ['MTA_KEY'], feed_id))
feed.ParseFromString(response.read())
print feed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment