Hacking on steroids          with YQLAnshu	  Prateek	  Search/YDN	  @anshprat	  
Hacking togethersystems in 24 hours islot of fun.
Data manipulationHacks =           +          Data visualization
The web has lot of data around
ProgrammableWeb.Com – 6831 APIs
Yahoo! has opened    up its data
http://developer.yahoo.com/everything.html
The	  trouble	  with	  data	    •  You need to find data API  •  Get Access – Signup for key  •  Find data endpoint  •  Re...
To make data access  easy on the web,Yahoo! created YQL
YQL turns webservices and data on    the web into     databases.
select {what} from {where}    where {conditions}
You can select, filter,   sort and limit
You can even insert,update and delete from          it.
Finding	  Videos	  about	  Bangalore	  •  SELECT	  *	  FROM	  youtube.search	  where	     query=bangalore	  
Selec@ng	  Photos	  of	  HackdaY	  •  SELECT	  *	  FROM	  flickr.photos.search	  where	  	     text="hackday”	  and	  api_k...
Inser@ng	  data	  •  INSERT	  INTO	  bitly.shorten	  (login,	  apiKey,	     longUrl)	  •  	  	  •  VALUES	  (ME,	  API_KEY...
upda@ng	  data	  •  UPDATE	  social.profile.status	  	  •  SET	  status="Using	  YQL	  UPDATE”	  	  •  WHERE	  guid="NJFIDH...
Retrieving	  my	  Contacts	  •  SELECT	  *	  FROM	  social.contacts	  WHERE	     guid=me	  
Accessing	  Private	  Data	        •  hYp://query.yahooapis.com/v1/yql	     	  Uses OAuth 1.0 for authorizationOAuth is co...
You can also mix and match several webservices using the in()      command.
select * from search.termextractwhere context in (select description     from rss where url=http://rss.news.yahoo.com/rss/...
Almost all the top APIs on web areaccessible from YQL
1255 APIs
Some	  of	  them	       amazon              foursquare   peerindex      apple              geo          salesforce       b...
You want even more?
Alright, how about this?           atom   json            csv   microformats           feed   rss           html   xml
The easiest way to start with YQL is to use the        consolehttp://developer.yahoo.com/yql/console
YQL: http://developer.yahoo.com/yql/console
How to get this data in     your app?
YQL is a REST API in itself and has two      endpoints
The public endpoint does not need any             authentication.http://query.yahooapis.com/v1/public/yql?        q={query...
The private endpoint needs oauth         authentication.http://query.yahooapis.com/v1/yql?    q={query}&format={format}
Output formats are XML       or JSON
Let’s	  See	  It	  
Query	  Examples	            select	  *	  from	            yahoo.finance.quotes	            where	  symbol	  in	           ...
Query	  Examples	           select	  *	  from	           weather.byloca@on	  where	           loca@on	  in	  ("bangalore,	...
•                             Query	  Examples	      Find	  hackday	  tweets:	  •  SELECT	  *	  FROM	  twi]er.search	  whe...
Query	  Examples	  •  Get	  Olympic	  medal	  list	  •  select	  *	  from	  html	  where	  url=h]p://sports.yahoo.com/olym...
Query	  Examples	  •  Scrape	  news	  from	  Yahoo!	  Finance:	  •  select	  *	  from	  html	  where	  url="h]p://finance.y...
There are lot of thingsyou can do with YQL.
Play yourself         http://developer.yahoo.com/yql/
One more thing
Don’t look for features.Solve one problem
Resources	  •  All	  Yahoo!	  APIs	  and	  Services	  •  hYp://developer.yahoo.com/everything.html	  	  •  YQL	  Documenta...
Thanks!	  http://www.slideshare.net/anshprat Anshu Prateek Twitter: @anshprat Github: http://github.com/anshprat Web: http...
Yql hacku iitd_2012
Yql hacku iitd_2012
Yql hacku iitd_2012
Yql hacku iitd_2012
Yql hacku iitd_2012
Yql hacku iitd_2012
Yql hacku iitd_2012
Yql hacku iitd_2012
Yql hacku iitd_2012
Upcoming SlideShare
Loading in...5
×

Yql hacku iitd_2012

629

Published on

hackU 2012 IIT Delhi YQL

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
629
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Yql hacku iitd_2012

  1. 1. Hacking on steroids with YQLAnshu  Prateek  Search/YDN  @anshprat  
  2. 2. Hacking togethersystems in 24 hours islot of fun.
  3. 3. Data manipulationHacks = + Data visualization
  4. 4. The web has lot of data around
  5. 5. ProgrammableWeb.Com – 6831 APIs
  6. 6. Yahoo! has opened up its data
  7. 7. http://developer.yahoo.com/everything.html
  8. 8. The  trouble  with  data   •  You need to find data API •  Get Access – Signup for key •  Find data endpoint •  Read docs to learn what parameters you have •  Get data in obscure format •  Use data after converting and filtering •  More APIs you use, more is your annoyance
  9. 9. To make data access easy on the web,Yahoo! created YQL
  10. 10. YQL turns webservices and data on the web into databases.
  11. 11. select {what} from {where} where {conditions}
  12. 12. You can select, filter, sort and limit
  13. 13. You can even insert,update and delete from it.
  14. 14. Finding  Videos  about  Bangalore  •  SELECT  *  FROM  youtube.search  where   query=bangalore  
  15. 15. Selec@ng  Photos  of  HackdaY  •  SELECT  *  FROM  flickr.photos.search  where     text="hackday”  and  api_key=“b5a60b2a…”  
  16. 16. Inser@ng  data  •  INSERT  INTO  bitly.shorten  (login,  apiKey,   longUrl)  •     •  VALUES  (ME,  API_KEY,  hYp://yahoo.com)    
  17. 17. upda@ng  data  •  UPDATE  social.profile.status    •  SET  status="Using  YQL  UPDATE”    •  WHERE  guid="NJFIDHVPVVISDX7UKED2WHU"  
  18. 18. Retrieving  my  Contacts  •  SELECT  *  FROM  social.contacts  WHERE   guid=me  
  19. 19. Accessing  Private  Data   •  hYp://query.yahooapis.com/v1/yql    Uses OAuth 1.0 for authorizationOAuth is complicated – use one of our SDKs athttps://github.com/yahoo
  20. 20. You can also mix and match several webservices using the in() command.
  21. 21. select * from search.termextractwhere context in (select description from rss where url=http://rss.news.yahoo.com/rss/topstories)
  22. 22. Almost all the top APIs on web areaccessible from YQL
  23. 23. 1255 APIs
  24. 24. Some  of  them   amazon foursquare peerindex apple geo salesforce bbc github slideshare bible google themovideb boss hackernews tumblr campfire ign twitter contentanalysis intuit vimeo craigslist kiva weather delicious klout yahoo dopplr lastfm youtube etsy netflix zillow facebook paypal
  25. 25. You want even more?
  26. 26. Alright, how about this? atom json csv microformats feed rss html xml
  27. 27. The easiest way to start with YQL is to use the consolehttp://developer.yahoo.com/yql/console
  28. 28. YQL: http://developer.yahoo.com/yql/console
  29. 29. How to get this data in your app?
  30. 30. YQL is a REST API in itself and has two endpoints
  31. 31. The public endpoint does not need any authentication.http://query.yahooapis.com/v1/public/yql? q={query} &format={format}
  32. 32. The private endpoint needs oauth authentication.http://query.yahooapis.com/v1/yql? q={query}&format={format}
  33. 33. Output formats are XML or JSON
  34. 34. Let’s  See  It  
  35. 35. Query  Examples   select  *  from   yahoo.finance.quotes   where  symbol  in   ("^IXIC","^DJI","YHOO ","AAPL")  
  36. 36. Query  Examples   select  *  from   weather.byloca@on  where   loca@on  in  ("bangalore,  in",   ”new  york,  us")  
  37. 37. •  Query  Examples   Find  hackday  tweets:  •  SELECT  *  FROM  twi]er.search  where  q=hackday’  •  Search  Yahoo!  Answers  for  resolved  ques@ons  about  cars:  •  select  *  from  answers.search  where  query="cars"    and  type="resolved”  •  Find  distance  between  Bangalore  and  Mumbai:  •  select  *  from  geo.distance  where  place1="bangalore"  and   place2="mumbai”  •  Extract  important  terms  from  top  stories  on  Yahoo!  news:  •  select  *  from  search.termextract  where  context  in  (select  descrip@on   from  rss  where  url=h]p://rss.news.yahoo.com/rss/topstories)  
  38. 38. Query  Examples  •  Get  Olympic  medal  list  •  select  *  from  html  where  url=h]p://sports.yahoo.com/olympics/ medals.html  and  xpath=//*[@id=mediasportsoverallmedalcount]/ div[2]/table/tbody/tr/td/a  •  Shorten  a  URL:  •  insert  into  yahoo.y.ahoo.it  (url,  keysize)  values  (h]p:// www.javarants.com,  5)  •  Search  apartments  in  criagslist:  •  select  *  from  craigslist.search  where  loca@on="bangalore"  and   type="apa"  and  query="indiranagar”  
  39. 39. Query  Examples  •  Scrape  news  from  Yahoo!  Finance:  •  select  *  from  html  where  url="h]p://finance.yahoo.com/q? s=yhoo"  and  xpath=//div[@id="yfi_headlines"]/div[2]/ul/li/ a’  •  Select,  filter  data  from  google  spreadsheets:  •  select  *  from  csv  where  url="h]ps:// spreadsheets.google.com/pub?key=0ArYndzim-­‐ lbrdF8wc3A5QWl1ZGRpdkxRZk80SU9zUXc&output=csv"  and   col5  like  Bangalore%’  ;  
  40. 40. There are lot of thingsyou can do with YQL.
  41. 41. Play yourself http://developer.yahoo.com/yql/
  42. 42. One more thing
  43. 43. Don’t look for features.Solve one problem
  44. 44. Resources  •  All  Yahoo!  APIs  and  Services  •  hYp://developer.yahoo.com/everything.html    •  YQL  Documentahon  •  hYp://developer.yahoo.com/yql      •  YQL  Console  •  hYp://developer.yahoo.com/yql/console    •  YQL  Github  Account  (Contribute  Tables)  
  45. 45. Thanks!  http://www.slideshare.net/anshprat Anshu Prateek Twitter: @anshprat Github: http://github.com/anshprat Web: http://hackalyst.info
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×