Choose a Better Train With Web Scraping (hackaday.com)
szczys writes: Tired of his trains being constantly late, Eric Evenchick headed to the Via Rail (Canada's communter train service) website to find which trains had a better on-time rate. Unfortunately they only offer three days worth of data through the dropdown selections — but a bit of investigating showed the GET requests were open for about the last six months. Evenchick built a web-scraper with Python, along with a web interface that queries the resulting SQL db. The harvested data shows system-wide delays that average more than twelve minutes (mostly due to commercial rail having the right-of-way). The good that comes of this? You can now choose your train based on smallest likelihood of delay..
>> Canada's communter train service
But do they have anything for commuters?
See Via Rail limiting the GET requests in 3... 2... 1... :)
Well, OK, there's the weekend ahead, perhaps Monday?
In any case it does look like commuter rail is a 2nd class citizen in Canada.
Violence is the last refuge of the incompetent. Polar Scope Align for iOS
Check the site's terms of service, scraping site contents may be in violation of the ToS.
I wrote a similar app about 15 years ago to scrape the Edmonton Transit System's route schedules (conveniently posted in generally well structured HTML at the time) so I could build a relational system and try and sort out predictive routes / times. Then I found out what I was doing was in violation of their ToS, I stopped my scraping service immediately (before getting called on it).
Clearly the website is based on a loophole, which can/will be closed at any time. Given the litigious nature of most corporations (and in this case, possibly a government agency), I wouldn't be surprised if the author doesn't get a cease & desist and/or lawsuit coming his way.
Other than that, this is pretty awesome and a hacker-worthy effort.
Make sure everyone's vote counts: Verified Voting
they include data on crew/dispatchers. That might also affect timeliness
It's not often that sloppy security on commercial sites are working in favor of their customer.
We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
VIA Rail is NOT a commuter train service. It offers "intercity passenger rail services", not commuter service, which Wikipedia defines better than I can: "Commuter rail, also called suburban rail, is a passenger rail transport service that primarily operates between a city centre, and the middle to outer suburbs...". Again, not what VIA Rail primarily does.
Examples of agencies which offer commuter rail service in Canada include Greater Toronto's GO Transit trains and Montreal's AMT. These do, indeed, offer service between communities forming part of a greater metropolitan area and said area's city centre. At least in Montreal, the AMT has some exclusive tracks and agreements on shared tracks which prioritize commuter trains over other scheduled trains at rush hour.
I'd rather choose my train based on where it's headed.
Being on time at the wrong destination is kinda useless.
If you have to be somewhere at a certain time, your choice of trains is limited.
So a guy wrote a script. Good for him, I guess, but why is this on /.?
Choosing my train based on the likelihood of delays instead of on where I am, where I want to go and what time it is. brilliant, wish I thought of it.
See the National Rail Enquiries APIs. Loads of information on train timetables, delays, maintenance schedules, and almost all for free.
http://www.programmableweb.com/api/national-rail-enquiries
yes, they indeed have their own private police force.
with apologies to Johnny Fever, train cops are NOT a myth (part of the Railway Act in 1923, iirc).
mark my words, if he's not rich and white, and maybe even if he is, he's going right to go to jail for this sort of planned terrorist activity.
not only for plotting such harm against the nation's critical infrastructure, but actually carrying it out, too!
and civilly, they're going to seize all of his assets.
there's a reason it's called being railroaded.
they can't actually kill him while the cameras are looking, by the time they're done, he'll have sure wished they did.
Back then, Canadian National Railway, (the transcontinental freight RR whose track the vast majority of Via Rail passenger trains operate on), had a railcar tracking webpage, totally open, no login needed. One could enter, ten at a time, the fleet numbers of the Via coaches, sleepers, dining cars, etc (didn't work for locomotives ), and receive formatted text of the cars last known location and train # from across Canada, from CN'sdata gleaned from trackside RFID scanners. I had a script for several hundred cars, polling the Site on a daily basis. I would make monthly reports of Via Rail train timekeeping and car utilization and movements, to post to passenger rail discussion boards.
Alas, soon after 2001/09/11, CN cut off general public access to this data and made it a customer only login Site, for obvious paranoid security reasons. Fun while it lasted, even when this serviced was abused by railfans.
For Phildelphia is the US, please see TrainView and http://phor.net/apps/septa/ This includes a live and 8-year history of train on-time-performance and analysis of lateness.
"The good that comes of this? You can now choose your train based on smallest likelihood of delay."
Do it quickly, because, like always in these cases, the guy will be sued for data theft in 3, 2, 1, ...
Get up earlier instead of staying up too late writing silly scripts.
Table-ized A.I.
Damn, someone should do this for Amtrak.. They're on-time performance is _HORRIBLE_