YQL: Master Of the Mix

1,931 views

Published on

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

No Downloads
Views
Total views
1,931
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
6
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

YQL: Master Of the Mix

  1. 1. YQL: Master of Mix
  2. 2. Hello!!IIT Madras
  3. 3. Mixing is amazing!!
  4. 4. Mix Chemicals
  5. 5. Classic result of mixing
  6. 6. Classic result of mixing Steel
  7. 7. Mix Drinks
  8. 8. Mix Music
  9. 9. DATA
  10. 10. DATA
  11. 11. I am Markandey Singh {JavaScript Hacker} I work at Yahoo!
  12. 12. YQL is Fun….
  13. 13. YQL is Yahoo! Query Language
  14. 14. YQL is a web servicewhich works on SQL like syntax
  15. 15. On Webinformation is not structured
  16. 16. YQL makes easy toaccess unstructured data
  17. 17. THIS IS YQL CONSOLE
  18. 18. SELECT A TABLE
  19. 19. SEE QUERY HERE
  20. 20. OUTPUT
  21. 21. TAKE AWAY QUERYURL
  22. 22. URL outputhttp://query.yahooapis.com/{query}
  23. 23. URL output http://query.yahooapis.com/{query}<xml></xml>
  24. 24. URL output http://query.yahooapis.com/{query}<xml> { “json”:”json” }</xml>
  25. 25. JSON{ “name”: “markandey”}
  26. 26. JSON with callbackfoo ({ “name”: “markandey”});
  27. 27. YQL Console Demo
  28. 28. Lets see with example
  29. 29. Select * from interestingness
  30. 30. select * from flickr.photos.interestingness(20) whereapi_key=0fbb2b721757f77a6a9d038f4649a2b
  31. 31. select * from flickr.photos.interestingness(20) whereapi_key=0fbb2b721757f77a6a9d038f4649a2b
  32. 32. select * from flickr.photos.interestingness(20) where api_key=0fbb2b721757f77a6a9d038f4649a2b<img src=“//farm{farm-id}.staticflickr.com/{server-id}/{id}_{secret}.jpg“>
  33. 33. Here is the code
  34. 34. This is what you get http://bit.ly/yqlflickr
  35. 35. Flickr Demo
  36. 36. YQL With PHP$session = curl_init($yql_query_url);curl_setopt($session, CURLOPT_RETURNTRANSFER,true);$json = curl_exec($session);
  37. 37. YQL With YUIYUI().use(yql, function(Y) { Y.YQL(select * from weather.forecast where location=90210, function(r) { //r now contains the result of the YQL Query //use the YQL Developer console to learn //what data is coming back in this object //and how that data is structured. });});
  38. 38. YQL has many Yahoo!and non-yahoo tables
  39. 39. Page Scraping
  40. 40. Page Scraping URL
  41. 41. Page Scraping URL XPATH
  42. 42. Page Scrapingselect * from html where url=“------" and xpath=“--------”;
  43. 43. Your site!!
  44. 44. URL select * from html whereurl=“http://www.iitm.ac.in/csdept" and xpath=“……..”;
  45. 45. XPATH select * from html where url=“http://www.iitm.ac.in/csdept" andxpath=“//div[@id="content"]/div/tab le[3]”;
  46. 46. ChromYQLip chromy-clip
  47. 47. YQL console demo Page scraping
  48. 48. This is what You gethttp://bit.ly/searchiitm
  49. 49. Search demo
  50. 50. Content Analysis with YQL http://bit.ly/yqlcap
  51. 51. Picture me http://bit.ly/pikme
  52. 52. What else YQL can do????
  53. 53. You can create your own table Read more bit.ly/yqlODT
  54. 54. My random hello!! table
  55. 55. Table Demo
  56. 56. Store Secret on YQL insert intoYQL hosted yql.storage.admin storage (name, value) values (“value-name”,”value")
  57. 57. Store Secret on YQLYQL hosted storage
  58. 58. Store Secret on YQL execute select updateYQL hosted storage
  59. 59. Keys Demo
  60. 60. You Can Also AccessGoogle Spreadsheet via YQL
  61. 61. You need to publishspreadsheet to the web
  62. 62. You need to publish spreadsheet to the webhttps://docs.google.com/spreadsheet/pub?key=0AgGxPO1AxEhldFZDNzAzQldLSGp2MzVGVXdlUnIxeUE&output=html
  63. 63. You need to publish spreadsheet to the webhttps://docs.google.com/spreadsheet/pub?key=0AgGxPO1AxEhldFZDNzAzQldLSGp2MzVGVXdlUnIxeUE&output=CSV
  64. 64. You need to publish spreadsheet to the webhttps://docs.google.com/spreadsheet/pub?key=0AgGxPO1AxEhldFZDNzAzQldLSGp2MzVGVXdlUnIxeUE&output=CSVselect * from csv where url=’….
  65. 65. Siri vs fake
  66. 66. Siri Demo
  67. 67. 2 More Things
  68. 68. Foohttp://bit.ly/foocode
  69. 69. Foo Demo
  70. 70. CodeFoo plugin for Sublime Text 2 http://bit.ly/codefoo2
  71. 71. Codefoo demo
  72. 72. Reach me@markandey

×