Christian Heilmann

Posts Tagged ‘yql’

Another amazingly useful web site: http://ismycomputeron.com

Friday, January 9th, 2009

Sometimes you come across web services that are so amazingly useful, you wonder why nobody has done it before. One of those is Is my computer on? sent to me this morning by Tomas Caspers.

While the usefulness of the service is indisputable the lack of RSS feed or API is actually annoying (let’s not discuss the HTML quality of the site, I am sure this is because of performance reasons as it is the case with other big players). Likeminded web dwellers like Dion Almaer bemoaned the same fact which is why I’ve taken matters into my own hand and used YQL to turn this service into a JSON API:


http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22http%3A%2F%2Fismycomputeron.com%22%20and%20xpath%3D’%2F%2Fcenter%2Ffont%2Ftext()’&format=json&callback=isiton

This version wraps the resulting data (in my case “yes”) in a JSON object and calls the isiton() method. You can try it out for yourself.

If you want to change this simply rename isiton at the end of the url to your function name of choice. If you use alert() as the function name you could even turn this into a useful bookmarklet.

Of course you should never forget to support the library followers if you have a system like that and Mattias Hising came quickly to the rescue and built the system as a jQuery plugin.

TTMMHTM – Paul Carr at LeWeb, Stacking Game and a christmas message

Saturday, December 13th, 2008

Things that made me happy this morning:

But I’m not being entirely fair to LeWeb. Not all of the speakers were dull (some were just batshit weird)
Earlier this week, just before the start of LeWeb, Lord Drayson, Britain’s Minister for Science and Innovation, announced plans for a £1billion investment fund to support technology startups in the UK over the next few years. The plan was initially greeted with excitement by those startups, but already British cynicism has kicked in and questions are now being asked about how exactly the money will be divided up. Fortunately, my plan takes care of that too. I’m all about 360-degree thinking. ... A few hours ago I sent an email to Lord Drayson applying for all of the money. Every single penny of the one billion pounds. And when it arrives, I intend to spend it all organising the most earth-shatteringly brilliant two-day conference Europe — and the world — has ever seen. Unlike LeWeb, there will be no panels, no “fireside chats”, no goody bags, no live webcasting and absolutly no keynote speakers. Instead I’ll blow the entire budget by constructing a gigantic sauna, right in the middle of London … and surrounded by a moat of liquorice vodka. ... Every entrepreneur in Europe will be invited, and encouraged to bring a long straw … it’s almost impossible not to network when you’re crammed into a giant sauna with ten thousand entrepreneurs, investors and industry journalists, wasted on liquorice vodka. A ton of business will get done, a thousand partnerships will be made and after two days everyone will go home hungover, happy and filled with enough morale to easily ride out the recession And even more satisfying than all of that is the fact that the idea of a huge state-sponsored piss-up is such an anathema to Americans that there’s no way they can outdo us. Instead Kara, Michael and all those other smug Valley dwellers will be forced to look on enviously as Europe drinks, sweats, networks and bonds its way to a new dot com boom.

YQL is so the bomb to get web data as XML or JSON

Friday, December 12th, 2008

Yesterday I wrote a blog post on YDN about opening the web covering curl, pipes and YQL and today I did a more detailed deep-dive on Ajaxian about how YQL can help you to convert the web to JSON.

Suffice to say, I like YQL a lot – it is the command line interface to the web (and a text version of Yahoo Pipes). Go and play with it yourself:

YQL console

As explained in the Ajaxian article, all the non-authentication web services can be accessed through a public REST API. Simply add your YQL statement to http://query.yahooapis.com/v1/public/yql?q= and add a format=json parameter and a callback parameter with the name of your callback function and you are set.

This would for example to allow you to search for rabbit images on the web and display them quick and dirty with a few lines of JavaScript:





YQL allows you to access any freely available data service and even scrape HTML, how cool is that?