Created
December 8, 2009 05:58
-
-
Save kbranigan/251447 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| // Name of the location | |
| "name": "Drewry and Cactus-Gardenia Court", | |
| // The URI of the location, locations are groups of stops - they can be | |
| // intersections, stations or even specific addresses. | |
| // generally a Location has more then one stop, but sometimes there are | |
| // stops without an opposing direction stop and sits in a location by itself. | |
| // | |
| // Notes: | |
| // All locations and/or routes have a unique | |
| // human-readable URI that identify them in the system. | |
| // | |
| // All requests to the API use these URIs in the format | |
| // http://myttc.ca/:uri[.json|.xml] | |
| // | |
| "uri": "drewry_and_cactus-gardenia_court", | |
| // Time at which the API request was made | |
| "time": 1260254483, | |
| // (array) All stops that belong to this location | |
| // | |
| // stops can be grouped for specific directions, nearside/farside, | |
| // platforms in a station, stops for individual routes or blue night only stops | |
| "stops": [ | |
| { | |
| // name of the stop | |
| "name": "Eastbound on Drewry at Gardenia Court", | |
| // uri of the stop (see above - doing a request | |
| // to this uri returns the same result) | |
| "uri": "eastbound_on_drewry_at_gardenia_court", | |
| // (array) All the routes that *stop here* | |
| // this stop only has one route stop at it, but some stops have near a dozen | |
| "routes": [ | |
| { | |
| // name for the route | |
| "name": "125 Drewry", | |
| // agency for this route | |
| "agency": "Toronto Transit Commission", | |
| // uri for the route | |
| "uri": "125_drewry", | |
| // (array) Upcoming vehicle departure times at this stop for this route | |
| // | |
| // Notes: | |
| // Ordered by time, in ascending order. | |
| // | |
| // There will always be at least 3 of each distinct shape. | |
| // | |
| // In this case, there is only a single shape, so only 3 times | |
| // | |
| "stop_times": [ | |
| { | |
| // (unix timestamp) Time of vehicle departure | |
| // | |
| // Notes: | |
| // This is the timestamp of the vehicle departure. | |
| // | |
| // This value MAY NOT be for today - for example, | |
| // there are a few Sunday-only routes in the system | |
| // whose next 3 stoptimes may not occur for several | |
| // days - this should always be used in lieu of the | |
| // "departure_time" field for calculating the date. | |
| // | |
| "departure_timestamp": 1260269360, | |
| // Vehicle headsign | |
| // | |
| // Notes: | |
| // This is what's actually printed on the headsign of the vehicle. | |
| // | |
| // Useful for people to identify a particular branch | |
| // | |
| "shape": "125 Drewry to Finch Station", | |
| // Time of vehicle departure (all pretty like) | |
| // | |
| // Notes: | |
| // This field is for display purposes only - saves you | |
| // having to generate a pretty time. | |
| // | |
| // There is NO DATE INFORMATION encoded in this field (see above) | |
| // | |
| "departure_time": "5:49a", | |
| }, | |
| // repeats - for more documentation jump to the bottom | |
| { | |
| "departure_timestamp": 1260269840, | |
| "shape": "125 Drewry to Finch Station", | |
| "departure_time": "5:57a", | |
| }, | |
| { | |
| "departure_timestamp": 1260270320, | |
| "shape": "125 Drewry to Finch Station", | |
| "departure_time": "6:05a", | |
| } | |
| ] | |
| } | |
| ] | |
| }, | |
| // next stop, repeats for all stops in the location | |
| { | |
| "name": "Northbound on Cactus at Drewry Farside", | |
| "uri": "northbound_on_cactus_at_drewry_farside", | |
| "agency": "Toronto Transit Commission", | |
| "routes": [ | |
| { | |
| "name": "98 Willowdale-Senlac", | |
| "uri": "98_willowdale-senlac", | |
| // this route has 2 shapes, the stop times are still sorted | |
| // by time, but there are 6 stop times | |
| "stop_times": [ | |
| { | |
| "departure_timestamp": 1260269377, | |
| "shape": "98A Willowdale-Senlac to Sheppard-Yonge Station via Senlac", | |
| "departure_time": "5:49a", | |
| }, | |
| { | |
| "departure_timestamp": 1260270473, | |
| "shape": "98 Willowdale-Senlac to Peckham via Sheppard-Yonge Station", | |
| "departure_time": "6:07a", | |
| }, | |
| { | |
| "departure_timestamp": 1260271177, | |
| "shape": "98A Willowdale-Senlac to Sheppard-Yonge Station via Senlac", | |
| "departure_time": "6:19a", | |
| }, | |
| { | |
| "departure_timestamp": 1260272273, | |
| "shape": "98 Willowdale-Senlac to Peckham via Sheppard-Yonge Station", | |
| "departure_time": "6:37a", | |
| }, | |
| { | |
| "departure_timestamp": 1260272977, | |
| "shape": "98A Willowdale-Senlac to Sheppard-Yonge Station via Senlac", | |
| "departure_time": "6:49a", | |
| }, | |
| { | |
| "departure_timestamp": 1260274073, | |
| "shape": "98 Willowdale-Senlac to Peckham via Sheppard-Yonge Station", | |
| "departure_time": "7:07a", | |
| } | |
| ] | |
| } | |
| ] | |
| }, | |
| { | |
| "name": "Southbound on Cactus at Drewry", | |
| "uri": "southbound_on_cactus_at_drewry", | |
| "agency": "Toronto Transit Commission", | |
| "routes": [ | |
| { | |
| "name": "98 Willowdale-Senlac", | |
| "uri": "98_willowdale-senlac", | |
| "stop_times": [ | |
| { | |
| "departure_timestamp": 1260269114, | |
| "shape": "98A Willowdale-Senlac to Peckham via Senlac", | |
| "departure_time": "5:45a", | |
| }, | |
| { | |
| "departure_timestamp": 1260270725, | |
| "shape": "98 Willowdale-Senlac to Steeles via Senlac", | |
| "departure_time": "6:12a", | |
| }, | |
| { | |
| "departure_timestamp": 1260270914, | |
| "shape": "98A Willowdale-Senlac to Peckham via Senlac", | |
| "departure_time": "6:15a", | |
| }, | |
| { | |
| "departure_timestamp": 1260272525, | |
| "shape": "98 Willowdale-Senlac to Steeles via Senlac", | |
| "departure_time": "6:42a", | |
| }, | |
| { | |
| "departure_timestamp": 1260272714, | |
| "shape": "98A Willowdale-Senlac to Peckham via Senlac", | |
| "departure_time": "6:45a", | |
| }, | |
| { | |
| "departure_timestamp": 1260274325, | |
| "shape": "98 Willowdale-Senlac to Steeles via Senlac", | |
| "departure_time": "7:12a", | |
| } | |
| ] | |
| } | |
| ] | |
| }, | |
| { | |
| "name": "Westbound on Drewry at Cactus", | |
| "uri": "westbound_on_drewry_at_cactus", | |
| "agency": "Toronto Transit Commission", | |
| "routes": [ | |
| { | |
| "name": "125 Drewry", | |
| "uri": "125_drewry", | |
| "stop_times": [ | |
| { | |
| "departure_timestamp": 1260270461, | |
| "shape": "125 Drewry to Bathurst Torresdale", | |
| "departure_time": "6:07a", | |
| }, | |
| { | |
| "departure_timestamp": 1260270941, | |
| "shape": "125 Drewry to Bathurst Torresdale", | |
| "departure_time": "6:15a", | |
| }, | |
| { | |
| "departure_timestamp": 1260271421, | |
| "shape": "125 Drewry to Bathurst Torresdale", | |
| "departure_time": "6:23a", | |
| } | |
| ] | |
| } | |
| ] | |
| } | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment