Yql hacku iitd_2012
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Yql hacku iitd_2012

  • 930 views
Uploaded on

hackU 2012 IIT Delhi YQL

hackU 2012 IIT Delhi YQL

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
930
On Slideshare
871
From Embeds
59
Number of Embeds
2

Actions

Shares
Downloads
7
Comments
0
Likes
0

Embeds 59

http://www.cse.iitd.ac.in 35
http://www.cse.iitd.ernet.in 24

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Hacking on steroids with YQLAnshu  Prateek  Search/YDN  @anshprat  
  • 2. Hacking togethersystems in 24 hours islot of fun.
  • 3. Data manipulationHacks = + Data visualization
  • 4. The web has lot of data around
  • 5. ProgrammableWeb.Com – 6831 APIs
  • 6. Yahoo! has opened up its data
  • 7. http://developer.yahoo.com/everything.html
  • 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. To make data access easy on the web,Yahoo! created YQL
  • 10. YQL turns webservices and data on the web into databases.
  • 11. select {what} from {where} where {conditions}
  • 12. You can select, filter, sort and limit
  • 13. You can even insert,update and delete from it.
  • 14. Finding  Videos  about  Bangalore  •  SELECT  *  FROM  youtube.search  where   query=bangalore  
  • 15. Selec@ng  Photos  of  HackdaY  •  SELECT  *  FROM  flickr.photos.search  where     text="hackday”  and  api_key=“b5a60b2a…”  
  • 16. Inser@ng  data  •  INSERT  INTO  bitly.shorten  (login,  apiKey,   longUrl)  •     •  VALUES  (ME,  API_KEY,  hYp://yahoo.com)    
  • 17. upda@ng  data  •  UPDATE  social.profile.status    •  SET  status="Using  YQL  UPDATE”    •  WHERE  guid="NJFIDHVPVVISDX7UKED2WHU"  
  • 18. Retrieving  my  Contacts  •  SELECT  *  FROM  social.contacts  WHERE   guid=me  
  • 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. You can also mix and match several webservices using the in() command.
  • 21. select * from search.termextractwhere context in (select description from rss where url=http://rss.news.yahoo.com/rss/topstories)
  • 22. Almost all the top APIs on web areaccessible from YQL
  • 23. 1255 APIs
  • 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. You want even more?
  • 26. Alright, how about this? atom json csv microformats feed rss html xml
  • 27. The easiest way to start with YQL is to use the consolehttp://developer.yahoo.com/yql/console
  • 28. YQL: http://developer.yahoo.com/yql/console
  • 29. How to get this data in your app?
  • 30. YQL is a REST API in itself and has two endpoints
  • 31. The public endpoint does not need any authentication.http://query.yahooapis.com/v1/public/yql? q={query} &format={format}
  • 32. The private endpoint needs oauth authentication.http://query.yahooapis.com/v1/yql? q={query}&format={format}
  • 33. Output formats are XML or JSON
  • 34. Let’s  See  It  
  • 35. Query  Examples   select  *  from   yahoo.finance.quotes   where  symbol  in   ("^IXIC","^DJI","YHOO ","AAPL")  
  • 36. Query  Examples   select  *  from   weather.byloca@on  where   loca@on  in  ("bangalore,  in",   ”new  york,  us")  
  • 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. 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. 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. There are lot of thingsyou can do with YQL.
  • 41. Play yourself http://developer.yahoo.com/yql/
  • 42. One more thing
  • 43. Don’t look for features.Solve one problem
  • 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. Thanks!  http://www.slideshare.net/anshprat Anshu Prateek Twitter: @anshprat Github: http://github.com/anshprat Web: http://hackalyst.info