September 2022

S M T W T F S
    123
45678910
11121314151617
181920 21222324
2526 27282930 

Style Credit

Expand Cut Tags

No cut tags
Wednesday, October 24th, 2007 09:16 am
I know this won't be useful to many of you, but I wanted to get it indexed as a public service.

If you want to create a link to Vancouver TransLink's NextBus page that will always load for right now (as compared to the time when you happened to bookmark it), add a bookmark with the following URL:

javascript:d = new Date(); document.location = "http://tripplanning.translink.bc.ca/hiwire?.a=iNextBusFind&.s=%7B%24SID%7D&ShowTimes=1&NumStopTimes=5&LineDirId=&GetSchedules=1&Geocode=0&FormState=0&StopAbbr=XXXXX&FromHourDropDown=" + d.getHours() * 100 + "&FromMinuteDropDown=" + d.getMinutes() + "&FromMeridiemDropDown=" + (d.getHours() >= 12 ? 'p' : 'a') + "&SB=Search&.a=iTripPlanning";

Replace XXXXX with whatever stop number you're interested in. Boom, quick and easy way to check for the next bus arrival.
Wednesday, October 24th, 2007 04:34 pm (UTC)
yer stretching my friends page. can that go in a cut? :)
Wednesday, October 24th, 2007 05:54 pm (UTC)
Oh, and the link itself doesn't copy/paste in its current form. The 3rd line somehow got excluded
Wednesday, October 24th, 2007 06:48 pm (UTC)
That doesn't look like a URL I can copy & paste. That looks like some badly-formatted javascript code. Unless you meant for us to just C&P the URL part?
Wednesday, October 24th, 2007 06:58 pm (UTC)
You can use javascript as a URL; that's what the 'javascript:' at the beginning does. Instead of going somewhere, it executes the code. (Depending on exact security settings, of course.) In this case, the code then dynamically generates a real URL and sends you there.
Wednesday, October 24th, 2007 07:05 pm (UTC)
...if you're going to include javascript, can't you just have it pop up with some kind of form that asks you for the XXXXX stop number, instead of having to manually change the URL every single time? I mean, that extra stuff at the end looks like it adds some parameters that would make it relevant for right now, but when I click on the link, it gives me the right-now time anyway... so why the extra code if it does that anyway?

Just wondering...
Wednesday, October 24th, 2007 07:08 pm (UTC)
I meant, change XXXXX in the saved bookmark. Most people only use a handful of stops regularly, so it makes sense to make a quick and easy bookmark for each.
Wednesday, October 24th, 2007 07:11 pm (UTC)
If you visit the NextBus page, the form defaults to right now. But the search results have the time hardcoded into the URL, so if you bookmark that page, every time you visit it the results will be for the same time. Using the javascript lets you jump directly to the search results for right now. It's very silly that I have to do this -- the page should have a 'right now' option. But transit website tend to suck that way.
Wednesday, October 24th, 2007 07:32 pm (UTC)
That computes. And as much as I like silliness, it's nice to know I have friends out there who are good at dispelling this particular sort of silliness. Another blow struck for the cause of disgruntled public transportation users - huzzah!

&:þ
Wednesday, October 24th, 2007 07:07 pm (UTC)
You, and the internet, have made Team Aguilar's vacation better. We're about to hop a bus to UBC to check out the Museum of Anthropology and maybe catch some BSG locations. You're link made that much easier for us to do. Thanks!