YQL & Yahoo! Apis


Published on

The YQL & Yahoo! Apis presentation done in RHOK Bangalore

Published in: Technology, Design
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Give you an overview of YQLHow can you use it for your hacksWe will see lots of examples How you can extend by creating new APIs out of webpages/data sources and for executing JS on server orQnA
  • A.K,.A a big waste of time
  • A.K,.A a big waste of time
  • Youtube, Twitter, Facebook, Google, Amazon, eBay, Craigslist, Imdb, Last.fm
  • A.K,.A a big waste of time
  • Search, Flickr, Geo, Placemaker, placefinder, Social, News, Finance, Mail, Messenger, Address Book, Maps, Anwsers
  • A.K,.A a big waste of time
  • A.K,.A a big waste of time
  • A.K,.A a big waste of time
  • A.K,.A a big waste of time
  • YQL is a sql like language
  • A.K,.A a big waste of time
  • A.K,.A a big waste of time
  • A.K,.A a big waste of time
  • Community ResourcesHelping you be successful in using Yahoo! Web Services isn't just about code and documentation. We want to make it easy for developers to get in touch with us and others who are using our services to answer and ask questions, toss around ideas, and give your feedback on what services we could offer next.ForumsYDN General BoardsDesign PatternsHotJobsSearchYOSAPTMusicWidgetsGeoPlanetOpenIDY! GroupsAddress BookAnswersFireEagleDel.icio.usTrafficFlickrMailSearchBOSSMapsJavaScriptSilverlightMerchant SolutionsSearch MarketingExceptional PerformanceYUIJava.NetFlashYDN EUAuthPHPPythonRubyPerlEventsWant your tech event appear in the YDN 'Upcoming Events' stream on developer.yahoo.com homepage? List your event on Upcoming and then add it to the Yahoo! Developer Network group on Upcoming. If you are setting up a tech event for developers or designers and would like some Yahoo! involvement, please contact us.ExpertsYahoo! Developer Network is on the lookout for experts to share knowledge and help grow our developer communities. If you are interested in applying to moderate a *group* or forum and become an official expert, please contact us for more information. Remember, we pay in hugs, link-love and schwag only.BlogThe YDN blog is where we talk about our various Yahoo! developer offerings and YDN events around the world. Your comments welcome. If you have a suggestion for the blog or a blog post you'd like to write about your experiences using our APIs or services, let us know. We are particularly interested in posts using Yahoo! APIs, tools, webservices and coverage of tech events. If you need inspiration or want to run some ideas by us, please contact us.YDN TheaterYDN Theater is chock-full of API deep dives, developer interviews, cutting- edge technologies, and recaps of tech events you wish you hadn't missed. If you have an idea for a story, please contact us.
  • YQL & Yahoo! Apis

    1. 1. YQL & YAHOO! APIS Jai Santhosh Frontend Engineer, Hacker Yahoo!
    2. 2. What We’re Going to Cover• YQL Overview• Making Queries and the Console Sandbox• Demo• Open Data Tables and Execute (Server-Side JavaScript)• Final Lessons
    3. 3. Data manipulationHacks = + Data visualization
    4. 4. The web is a large pile of data!
    5. 5. ProgrammableWeb.com – 4480 Apis
    6. 6. Yahoo! has alsoopened up its data
    7. 7. http://developer.yahoo.com/everything.html
    8. 8. Trouble with Data• 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 web services and data on the web into databases.
    11. 11. select {what} from {where} where {conditions}
    12. 12. You can select, filter, sortand limit data and you can even insert, update and delete from it.
    13. 13. YQL: http://developer.yahoo.com/yql/console
    14. 14. Finding Videos about Bangalore• SELECT * FROM youtube.search where query=bangalore
    15. 15. Selecting Photos of RHOK• SELECT * FROM flickr.photos.search where text="rhok"
    16. 16. Inserting dataINSERT INTO bitly.shorten (login, apiKey, longUrl)VALUES (ME, API_KEY, http://yahoo.com)
    17. 17. updating dataUPDATE social.profile.statusSET status="Using YQL UPDATE”WHERE guid="NJFIDHVPVVISDX7UKED2WHU"
    18. 18. Accessing Private Data • http://query.yahooapis.com/v1/yqlUses OAuth 1.0 for authorizationOAuth is complicated – use one of our SDKs athttps://github.com/yahoo
    19. 19. Retrieving my profile• SELECT * FROM social.contacts WHERE guid=me
    20. 20. Using the YQL Consolemakes it very easy to use it.
    21. 21. url structure• http://query.yahooapis.com/v1/yql?[params]• http://query.yahooapis.com/v1/public/yql?[para ms] Params q= [ YQL QUERY ] format = [ XML / JSON ] diagnostics = [ true / false ] debug = [ true / false ] callback = [ function name ]
    22. 22. Let’s See It
    23. 23. Query Samples• SELECT * FROM twitter.search where q=hackathon’ limit 5• select * from answers.search where query="cars" and type="resolved"• select * from google.translate where q="this is a test" and target="hi";• select * from google.translate where q in (select text from twitter.search where q="hackday") and target=hi;• select * from search.termextract where context in (select description from rss where url=http://rss.news.yahoo.com/rss/topstories)
    24. 24. Query Samples• select * from yahoo.finance.quotes where symbol in ("YHOO","AAPL","GOOG","MSFT")• insert into yahoo.shortener (url, keysize) values (http://www.javarants.com, 5)• select * from craigslist.search where location="bangalore" and type="apa" and query="indiranagar”• select * from html where url="http://finance.yahoo.com/q?s=yhoo" and xpath=//div[@id="yfi_headlines"]/div[2]/ul/li/a’
    25. 25. Making Requests: Flickr URLs<photo farm="3" id="5708163920" isfamily="0" isfriend="0" ispublic="1" owner="31832337@N04" secret="0075137487" server="2496" title="San Francisco"/>
    26. 26. Making Requests: Flickr URLsPhoto URLhttp://farm{$farm}.static.flickr.com/{$server}/{$id}_{$secret}.jpgPhoto Page URLhttp://www.flickr.com/photos/{$owner}/{$id}Photo Owner Profile URLhttp://www.flickr.com/photos/{$owner}
    27. 27. YQL is open – you can get your data tables in our system
    28. 28. Craigslist data table<table> <meta> <author>Yahoo! Inc.</author> <documentationURL>http://craigslist.org/</documentationURL> <sampleQuery> select * from {table} where location="sfbay" and type="sss" and query=“bike” </sampleQuery> </meta> <bindings> … </bindings></table>
    29. 29. Craigslist data table<table> <meta> … </meta> <bindings> <select itemPath="" produces="XML"> <urls> <url>http://{location}.craigslist.org/search/{type}?format=rss</url> </urls> <inputs> <key id="location" type="xs:string" paramType="path" required="true"/> <key id="type" type="xs:string" paramType="path" required="true"/> <key id="query" type="xs:string" paramType="query" required="true"/> </inputs> </select> </bindings></table>
    30. 30. Upload XML to our Github http://github.com/yql/yql-tables
    31. 31. Or to your own Site• The USE clauseUSE http://www.mysite.com/my_table.xmlAS mytable;SELECT * FROM mytableWHERE user=john_doe
    32. 32. You can even write server sidejavascript to build a webservice
    33. 33. Final Lessons• YQL is a skeleton key for all Yahoo! APIs• Open data tables allow you to create new data feeds out of one or many different raw sources• There are 1200+ Tables in YQL covering all major APIs on the web• Use SDKs when accessing private data that requires OAuth
    34. 34. Final Lessons: Links• All Yahoo! APIs and Services• http://developer.yahoo.com/everything.html• YQL Documentation• http://developer.yahoo.com/yql• YQL Console• http://developer.yahoo.com/yql/console• YQL Github Account (Contribute Tables)• http://github.com/yql/yql-tables
    35. 35. http://isithackday.com/hackday-toolbox/
    36. 36. Questions?http://www.slideshare.net/jaisanth Jai Santhosh Twitter: @jaisanth Github: http://github.com/jaisanth
    37. 37. THANK YOU!