Playing with YQL
May 17th, 2009
Note: this is an edited repost from Halans.com.
Have been playing with Yahoo!’s YQL this weekend, querying the Sydney Ferries website. Pretty amazing what it allows you to do, though the Sydney Ferries site wasn’t the best site to start playing with I guess. I did have a need to have the ferry timetable on my iPhone (especially the Neutral Bay service), so that’s why I put together Next Sydney Ferry this weekend.
The premise is pretty simple: when does the next ferry depart from Circular Quay? I had this wild idea to do cool stuff with it, but inspired by the simplicity of Next Manly Ferry, I thought I’d start out pretty simple too. And it certainly still is a work in progress with plenty of bugs.
NextSydneyFerry.com parses the timetables of the SydneyFerries.info site using YQL and JSONP. No luck with any API, so it’s pretty fragile reading in the HTML table data. Wish they made an effort marking up the data a bit more helpful (as in markup-as-an-api). One of the URLs even has a typo (“weekemd”). I additionally notice YQL not returning any results for the same query, while at other times it would, so they have some bugs too. It was an interesting YQL experiment, but since the data is not too dynamic, I will probably switch to using a more static datastore, which would also be a lot more responsive, and which would be lighter on your mobile dataplan. This is very much a first version application, with limited functionality (it shows you only the next and thereafter ferry, and only departing from Circular Quay), some noteworthy points:
- it uses the server’s time so tourists don’t have to have their mobiles set to local time.
- it updates the time in the background without a page refresh.
- It allows you to bookmark your daily service.
Sydney Ferries allows you to repurpose their content, as long as you add their copyright notice and don’t charge for it. But they could have made it a lot easier for people to do so.
Category: Javascript
Tags: api, HTML, screenscraping, Yahoo!, yql
About