Thursday, November 3, 2011

GRT API

It's been a while since I posted here. I've been busy looking for a job and being homeless and such. However I've come up with a little idea for a project while I was waiting for the bus the other day.

All the ways I have found to check for bus schedules in my city to be tedious and cumbersome. I like to fix bad systems, so while riding to my destination I started imaging a much better app that would allow people to quickly check bus times. The UI design and level of involvement seemed more then a quick app, especially when I wanted to release something for web and multiple mobile platforms. Then it hit me, why not build a simple web protocol to let all the other developers in my area have easy, query-able access to GRT data.

Enter GRT API.

I'll be building it quickly on Google App Engine. You send it specific URL queries and it'll return a JSON object of bus times. Let's take a look at options.

  • stop_id : specify a stop id to narrow the search down by
  • bus_name : specify a certain bus
  • stop_time, start_time : A stopping and starting time to look for
  • num_results : the max number of results you want per bus
  • gpslog, gpslat, gpsrange : provide it with your gps data plus a range and it'll limit the results.
So what will this return? A JSON objects of stops, which contains an array of buses, with an array of times.

First step? Let's get that data!


UPDATE 1:
First thing I wanted to add to this is different URLs the developer can go to to get lists of certain bits of data. Like a list of all the bus names, or a list of all stops with geodata, id, and addresses. Could be fun.

UPDATE 2:
Switching over to Java as the appengine backend code. Good news! I found that all the grt schedules are open to the public. Unfortunately it's in a zip with text files. I'm probably going to write a quick C# app that'll tear the zip apart and rebuild the data I need into an easily uploaded txt. Quick fix for now, I'll look into possibilities where the server itself could parse out this data. I'm switching my work over to the java environment, then running off the campus for a few hours. Continue it after then.

No comments:

Post a Comment