See-Why.Net

  • Home
  • About
  • Projects

See why...

Hi! My name is Christine, I am Computer Science and Biology student at UBC. This blog will be about two of my interests: programming and crafting.
  • Archives

    • July 2011
    • September 2010
    • July 2010
    • June 2010
    • May 2010
  • Categories

    • Code Notebook (1)
    • CPSC430 (12)
    • Crafting (2)
    • Firefox Extension Development (1)
    • Programming (2)
    • Site Talk (1)
  • Tags

    blue shrink plastic origami BusTime Extensions svn subclipse form api jquery drupal 7 version control eclipse Firefox microsoft facebook introduction wordpress livejournal kantianism copyright social contract theory internet utilitarianism crafts earrings ethics
  • Search

Sep
05
2010

BusTime Firefox Extension Progress

Filed under Firefox Extension Development

I’ve been wanting to make myself a Firefox extension that would display the next bus times at my home bus stop since forever. I don’t know how many times when I’m about to go out, but forget to check the buses until the last minute and then finding out that the bus just left. If only the bus schedule was in the status bar for me to see as I web surf!

I live in Metro Vancouver, and the local bus operator, Translink maintains a pretty good online system of bus times. Whether or not the bus drivers follow the schedule is another story, but lately it has been ok. I do remember times when buses were 30+ minutes late D:

Today I finally made some effort towards actually building the extension, and I actually made progress!

BusTime Screenshoot

It makes use of Translink’s own NextBus feature, looks up a bus route at a particular stop and shows it in the Firefox status bar. Now I just need to add user preferences to set the refresh interval, and the GUI to input the bus stop and bus route numbers. And test it of course. :)


The most useful article I used so far was one from the Mozilla Development Center: Creating a Dynamic Status Bar Extension. It does something really similar, loading stocks quotes from yahoo stocks. It teaches how to use the XMLHttpRequest object to get data from an URL. However ir doesn’t tell you that you need to wait for the page to load though, and that caused me many hours of confusion *laugh* You need to wait for the XMLHttpRequest object’s readyState to change to 4 (completed), which I now know thanks to this ajax tutorial. So yes, if you want to make a similar extension that’s all you need. And if you live in Metro Vancouver, I might put my extension up for download when I’m done…

Oh, and this is pretty obvious but I’m not affiliated with Translink in anyway. And now the stop# shown above is not my home stop, and that is not the bus I take. :P

Tags: BusTime, Extensions, Firefox || trackback

Leave a Reply

Click here to cancel reply.

© Christine Y. 2010. Powered by Wordpress.