5 ms·
How Fucked is Muni
- skimbrel 16y agoNice to see something of my own show up on HN. For the curious: The site is a very simple Dancer app running in Starman on an EC2 instance. The data comes from ProximoBus (http://proximobus.appspot.com/ http://proximobus.appspot.com/), a lightweight JSON-format wrapper for NextMuni's API. Three things contribute to a route being "fucked": - Percentage of vehicles on the route marked as delayed by NextBus - Size of the smallest gap between vehicles running in the same direction ('bunching') - Size of the largest gap between vehicles running in the same direction (the other effect of bunching) Code is up on github: https://github.com/skimbrel/how-fucked-is-muni https://github.com/skimbrel/how-fucked-is-muni Enjoy!
- mikeyk 16y agoThanks for this! My dream Muni app would show the average time it's currently taking to get through the Market underground section (where I see most of the bottlenecks, esp. on the N). This is a good proxy in the meantime :)
- skimbrel 16y agoHmm, that's not a bad metric. Maybe I can write up a special function for the metro lines that computes headways in the Market Street Subway and incorporates those into the status calculations. The main issue is that until I go through and rewrite the whole thing to do long-polling for every line, it's expensive to compute each route since I have to make several requests to ProximoBus to get all the necessary data. Caching for five minutes helps, but it's still less than ideal.
- anigbrowl 16y agoI've been meaning to do something like this for ages - well done. I didn't look at the source yet - I hope you're storing stats somewhere? I clicked on the L and my wife was skeptical, given the length of time it took her to get home. (The L seems particularly subject to bunching delays, by over-compensating line supervisors...it's common to walk the 1.5 miles home and pass 5, 6, 7 or even 8 trains coming in the opposite direction.)
- zasz 16y agoI clicked around on seven lines or so, and got "0 out of 0 vehicles delayed, are you sure this line is even running?" several times.
- skimbrel 16y agoHeh. Yeah, that's because a good portion of all the lines listed are rush-hour-only express variants of the main lines, or late-hours skeleton service (for the lettered LRV routes). I'm working on adding information on when each line is scheduled to run and what its expected headway is, so look for the inactive lines to disappear and for info on those that are running to get more accurate!
- cageface 16y agoThis is one of the rare cases where I think sparklines might add a lot to the user experience. A sea of informationless icons doesn't invite me in.
- pwenzel 16y agoWait wait, your transit operator has an API? How fucked is that?
- skimbrel 16y agoIt isn't the SFMTA themselves -- they contract with an operation called NextBus. NextBus installs GPS tracking devices on the transit vehicles, which radio their route, direction, and position back to a central system that then computes ETAs for all the stops on the route. That info is then exposed via a website, an SMS gateway, custom digital signs at the stops themselves, and via the API. It's incredibly useful to have, and there are half a dozen apps out for iOS and Android that show this info to you on the go.
- city41 16y agoIf by fucked you mean fucking cool, then very.
- pwenzel 16y ago(Indeed, I meant surprisingly cool)
- crikli 16y agoI had no clue what "Muni" was Googling led me to the San Francisco Municipal Transportation Authority. Most of the routes referenced are here: http://www.sfmta.com/cms/asystem/routelist.php http://www.sfmta.com/cms/asystem/routelist.php
- kbob 16y agoI'd guessed either New York or London.
- jgv 16y agoThis is rad. Anyone on here see "Is the L Train Fucked" (http://istheltrainfucked.com http://istheltrainfucked.com)? I hacked that together a month or two ago. I hope we start to see more apps built on public transpo APIs! edit: also on github --> http://github.com/jgv/is-the-l-train-fucked http://github.com/jgv/is-the-l-train-fucked
- deleted 16y ago[deleted]
- skimbrel 16y agoOops, this was not the comment I meant to reply to.
- ghouse 16y agoLove the simple interface. I have been giving a site like this thought for the past six months. I like that you haven't focused on "is it on schedule" but more "how long am I going to wait" I would love a distribution of the space between busses and trains at specific stops. For example, for the N line, at Cole & Carl, show me the frequency distribution of time between trains (and include an indication of what it's supposed to be). When three appear all within 5 minutes, I know someone is in for a very long wait.
- skimbrel 16y agoAnother great suggestion! I've added all of these as issues in github, so as I have free time I'll start building out more features.
- thuddwhirr 16y agoNice. Any plans to expose this via an api?
- ajays 16y agoIs it possible to get the positions of all the vehicles in 1 shot? I would hate to hit the API for each vehicle, in every route.
- enf 16y agoYes, if you make the vehicleLocations request without specifying a route (http://webservices.nextbus.com/service/publicXMLFeed?command=vehicleLocations&a=sf-muni&t=0 http://webservices.nextbus.com/service/publicXMLFeed?command...) you get the locations of all the vehicles at once.