-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Train_stations query produces empty array #3
Comments
Hey there - it looks like they changed the page we're scraping so it'd need to be fixed. I'll take a look when I get a chance if you'd like? |
That would be great, thanks. It is a bit beyond my skill set to try and fork it and fix it. |
I think the changes required are to transperth-api/lib/transperth_client.rb : Line 23, change to:
Line 73, change to:
Line 84, change to:
Line 126, change to (there's only one select on the entire page):
I can't install ruby 1.9 otherwise I'd test it myself. Note that the %s in the URL_SCHEME needs to resolve to something like "perth+underground+Stn". It is case-insensitive, but needs the trailing "+stn". |
Big +1 for getting this working again. I'm going to give the above changes suggested by @andrewgoz shortly, and if they don't work, try fixing it myself |
Hey guys - thanks for the work and sorry I let it slip again. I've pushed the updated version (there were a few other changes) - and it's working again it appears (see http://api.perthtransit.com/1/train_stations/armadale) - If all works for you guys, I'll update and make sure you get credit in the readme @andrewgoz - thanks! |
Wicked, thanks @Sutto |
I knew this just needed a gentle poke :-) I can confirm the changes work - just published my updated Pebble app with new train information! Thanks muchly @Sutto. |
It seems to be missing the first train? |
Hey guys, This was a bug to do with the page change - they moved the headers into a thead element (Yah!) so the scraper had incorrect data. I've fixed this (and made a few other general tweaks) and am deploying it now with the changes. |
Seems good now :-) |
Forgive me if I am doing something wrong, this is just something I am playing around with however from the best of my knowledge something is broken with the train times response
the URL: http://api.perthtransit.com/1/train_stations/perth
Provides:
{"response":{"lat":"-31.9510907808","lng":"115.859925408","name":"Perth","times":[],"compact":false,"identifier":"perth"}}
Whilst I was expecting:
{
"response": {
"identifier": "perth",
"compact": false,
"lat": "-31.9510908",
"lng": "115.8599254",
"name": "Perth",
"times": [{
"cars": 4,
"line": "Midland",
"on_time": true,
"pattern": null,
"platform": 7,
"status": "On Time",
"time": "19:00"
}, {
"cars": 2,
"line": "Fremantle",
"on_time": true,
"pattern": "K",
"platform": 5,
"status": "On Time",
"time": "19:02"
}, {
"cars": 4,
"line": "Armadale",
"on_time": true,
"pattern": "C",
"platform": 6,
"status": "On Time",
"time": "19:02"
}]
}
}
Is the empty times array a result of some broken interface with transperth or is my query wrong?
The text was updated successfully, but these errors were encountered: