hacku barcelona 2011: yql

15
Friday, 11 February 2011 Everyone has an API these days; Google, Amazon, Twitter, Microsoft, Facebook, Yahoo, and a billion others. All of them are dierent, though, so you end up having to write your own wrappers for each. and. every. one.

Upload: steve-marshall

Post on 27-May-2015

2.146 views

Category:

Technology


1 download

DESCRIPTION

A brief introduction to YQL for the students at Universitat Politècnica de Catalunya participating in HackU 2011.

TRANSCRIPT

Page 1: HackU Barcelona 2011: YQL

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.

Page 2: HackU Barcelona 2011: YQL

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.

Page 3: HackU Barcelona 2011: YQL

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!

Page 4: HackU Barcelona 2011: YQL

Friday, 11 February 2011

This is the console. You can enter queries here…

Page 5: HackU Barcelona 2011: YQL

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=

Page 6: HackU Barcelona 2011: YQL

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?

Page 7: HackU Barcelona 2011: YQL

Friday, 11 February 2011

Let’s start by finding tweets about Egypt…

(select * from twitter.search where q='egypt')

Page 8: HackU Barcelona 2011: YQL

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?

Page 9: HackU Barcelona 2011: YQL

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)

Page 10: HackU Barcelona 2011: YQL

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"')

Page 11: HackU Barcelona 2011: YQL

Friday, 11 February 2011

Give it a UI… that’s a hack!

(http://icant.co.uk/goohoobi/index.php?search=cat&style=)

Page 12: HackU Barcelona 2011: YQL

Friday, 11 February 2011

Page 13: HackU Barcelona 2011: YQL

Friday, 11 February 2011

Grab all the links from the CNN homepage.

(select * from html where url='http://cnn.com/' and xpath='//a')

Page 14: HackU Barcelona 2011: YQL

socialamazonameeanswersappdbapplearxivauthavatarsawsbasecampbatlasbbcbiblebitbizrateblackcountryhistorybostonbrazilbritishmuseumbrooklynbungiechristiescomicvinecouprecoupcraigslistdarkhelmetdeliciousdigg

digitalnzdopplrdostopsieduericssonlabsesmeetsyeyefifacebookfantasysportsfccfilemd5financefitbitflickrfolderscrapefoursquarefriendfeedgdacsgeogithubgooglegovgowallagreadergreenbookingsguardianhackernewshatenaign

imdbinfochimpsinstapaperintuitipkivalastfmlimewirestorelivedoorlocallongurlmapsmediawikiapimeetupmememendeleymicrosoftmiscmiximoviesmozillalabsmuseumoflondonmusicmybloglogmynewsdeskncbinestorianetflixneweggnextbus

ngmoconmmnmsinoaanprnytopenaustraliaopencalaisopencontextopenidopensocialpaypalpidgetspikchurplospubsubhubbubqueryrecoveryrssrtmsalesforceseafoodwatchsearchsearsseomozshelfarishippingshoppingshoppingcart

simplegeoslidesharesocialgraphsocialmentionsparqlspotifysunlighttarpipetesttextthemoviedbthetvdbtimeouttinysongtumblrtvragetwfytwitterukparliamentukpostcodeupcomingurbanesiausgsvictoriaandalbertvimeoweatherwesabewhitepageswordpress

Friday, 11 February 2011

Hundreds of APIs… all in one place. Accessible to your app…