hacku barcelona 2011: yql
DESCRIPTION
A brief introduction to YQL for the students at Universitat Politècnica de Catalunya participating in HackU 2011.TRANSCRIPT
Friday, 11 February 2011
Everyone has an API these days; Google, Amazon, Twitter, Microsoft, Facebook, Yahoo, and a billion others.
All of them are different, though, so you end up having to write your own wrappers for each. and. every. one.
Friday, 11 February 2011
YQL is different. YQL is the API for APIs. It turns the Internet into your database.
Want Google search results? Use YQL.Want a piece of text translated? Use YQL.Want to find a list of all the locations in a webpage? Use YQL.Want to get all the headers in a webpage? Use YQL.
YQL acts as middle-man between you and thousands of APIs (and growing). It searches, it translates, it geocodes! It would even make coffee, if you gave it an API for that.
select * from internet
Friday, 11 February 2011
YQL uses a SQL-like query language, allowing you to create simple queries from one API or really easily chain queries together.
All of this, using one language, against one endpoint that gives you everything on the Internet.
But how do you test your queries? To the console!
Friday, 11 February 2011
This is the console. You can enter queries here…
Friday, 11 February 2011
We can do simple things like ‘Search flickr for 10 cat pictures’.
http://www.flickr.com/search/?q=cat&w=all&m=&s=
Friday, 11 February 2011
By selecting from flickr.photos.search where the text is cat.
But what if we want to do something more complex?
Friday, 11 February 2011
Let’s start by finding tweets about Egypt…
(select * from twitter.search where q='egypt')
Friday, 11 February 2011
And now, let’s make them all Spanish…
select * from google.translate where q in (select text from twitter.search where q='egypt') and target="es";)
That’s pretty cool. What else can we do?
Friday, 11 February 2011
And now, let’s wrap a UI around that…
And we have a hack!
(http://isithackday.com/hacks/twitter-translate-form.php?search=egypt&amount=20&language=es)
Friday, 11 February 2011
Search Google, Bing, and Yahoo, all at once!
(select * from query.multi where queries=' select Title,Description,Url,DisplayUrl from microsoft.bing.web(20) where query="cat"; select title,clickurl,abstract,dispurl from search.web(20) where query="cat"; select titleNoFormatting,url,content,visibleUrl from google.search(20) where q="cat"')
Friday, 11 February 2011
Give it a UI… that’s a hack!
(http://icant.co.uk/goohoobi/index.php?search=cat&style=)
Friday, 11 February 2011
Friday, 11 February 2011
Grab all the links from the CNN homepage.
(select * from html where url='http://cnn.com/' and xpath='//a')
socialamazonameeanswersappdbapplearxivauthavatarsawsbasecampbatlasbbcbiblebitbizrateblackcountryhistorybostonbrazilbritishmuseumbrooklynbungiechristiescomicvinecouprecoupcraigslistdarkhelmetdeliciousdigg
digitalnzdopplrdostopsieduericssonlabsesmeetsyeyefifacebookfantasysportsfccfilemd5financefitbitflickrfolderscrapefoursquarefriendfeedgdacsgeogithubgooglegovgowallagreadergreenbookingsguardianhackernewshatenaign
imdbinfochimpsinstapaperintuitipkivalastfmlimewirestorelivedoorlocallongurlmapsmediawikiapimeetupmememendeleymicrosoftmiscmiximoviesmozillalabsmuseumoflondonmusicmybloglogmynewsdeskncbinestorianetflixneweggnextbus
ngmoconmmnmsinoaanprnytopenaustraliaopencalaisopencontextopenidopensocialpaypalpidgetspikchurplospubsubhubbubqueryrecoveryrssrtmsalesforceseafoodwatchsearchsearsseomozshelfarishippingshoppingshoppingcart
simplegeoslidesharesocialgraphsocialmentionsparqlspotifysunlighttarpipetesttextthemoviedbthetvdbtimeouttinysongtumblrtvragetwfytwitterukparliamentukpostcodeupcomingurbanesiausgsvictoriaandalbertvimeoweatherwesabewhitepageswordpress
Friday, 11 February 2011
Hundreds of APIs… all in one place. Accessible to your app…
http://query.yahooapis.com/v1/public/yql?q=<your query here>
Friday, 11 February 2011