Yahoo! Open Strategy – focus on YQL<br />Neil Wilkinson (Wilf)<br />Technical Director, Yahoo!7 and Yahoo!Xtra<br />2nd Ju...
Who am I and what am I doing here?<br /><ul><li>Wilf
You can call me Neil Wilkinson if you have to
Originally a POM, I’ve been living in Sydney for 8 years
Worked at Yahoo! in Australia for 6 years
Currently the Technical Director of Yahoo!7 and Yahoo!Xtramanaging “Technical Services”
A multi-disciplined team including Design, Front-End Engineering, Development, Operations, IT and Project Management – abo...
Here to share the joys of some of Yahoo!’s Open Strategy
Browser-independent front-end development
YQL – The Yahoo! Query Language – focus of today’s talk
Why is Yahoo! opening its technology?
Yahoo! only has thousands of developers
Millions of developers world-wide can use Yahoo!’s technology meaning that Yahoo! improves its technology from the feedbac...
Yahoo! is powered by Open Source technologies:
Linux, FreeBSD, Apache, PHP, MySQL, Bugzilla,Hadoop…
Yahoo! embraces open standards:
OpenID, OpenSocial, Microformats, OAuth
Yahoo! gives back to open source
YUI, github, YSlow
Employs RasmusLeodorf (PHP), Doug Crockford (Javascript), Mark Nottingham (Squid), etc</li></li></ul><li>So what technolog...
Design and develop for the user, not for the browser
Reset the browser CSS styles so all browsers have similar layout behaviour
Change the fonts so that they look the same cross-browser using percentage sizes (no more excuses for hard-coding font siz...
Use CSS grids – its just too hard to do it any other way: http://developer.yahoo.com/yui/grids/builder/
YUI Controls/Widgets include Calendar, Module, DataTable, etc: http://developer.yahoo.com/yui/calendar/</li></li></ul><li>...
Currently unlimited access to websearch API</li></li></ul><li>So what technology has Yahoo! opened?<br /><ul><li>Flickr
Most used photo API worldwide
http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=88dfe8282b22644fe806fa33018a3f50&user_id=31508066...
Upcoming SlideShare
Loading in …5
×

Yahoo xtra Open Technolgies

3,157 views

Published on

An introductory talk to Yahoo's developer offerings given by Neil Wilkinson in New Zealand.

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

No Downloads
Views
Total views
3,157
On SlideShare
0
From Embeds
0
Number of Embeds
95
Actions
Shares
0
Downloads
38
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Yahoo xtra Open Technolgies

  1. Yahoo! Open Strategy – focus on YQL<br />Neil Wilkinson (Wilf)<br />Technical Director, Yahoo!7 and Yahoo!Xtra<br />2nd July 2009<br />© 2007 Yahoo!7 Pty Limited<br />
  2. Who am I and what am I doing here?<br /><ul><li>Wilf
  3. You can call me Neil Wilkinson if you have to
  4. Originally a POM, I’ve been living in Sydney for 8 years
  5. Worked at Yahoo! in Australia for 6 years
  6. Currently the Technical Director of Yahoo!7 and Yahoo!Xtramanaging “Technical Services”
  7. A multi-disciplined team including Design, Front-End Engineering, Development, Operations, IT and Project Management – about 40 people.</li></li></ul><li>Who am I and what am I doing here?<br /><ul><li>What am I doing here?
  8. Here to share the joys of some of Yahoo!’s Open Strategy
  9. Browser-independent front-end development
  10. YQL – The Yahoo! Query Language – focus of today’s talk
  11. Why is Yahoo! opening its technology?
  12. Yahoo! only has thousands of developers
  13. Millions of developers world-wide can use Yahoo!’s technology meaning that Yahoo! improves its technology from the feedback of millions of developers.</li></li></ul><li>Yahoo! believes in “open”<br /><ul><li>Yahoo!’s technology uses Open
  14. Yahoo! is powered by Open Source technologies:
  15. Linux, FreeBSD, Apache, PHP, MySQL, Bugzilla,Hadoop…
  16. Yahoo! embraces open standards:
  17. OpenID, OpenSocial, Microformats, OAuth
  18. Yahoo! gives back to open source
  19. YUI, github, YSlow
  20. Employs RasmusLeodorf (PHP), Doug Crockford (Javascript), Mark Nottingham (Squid), etc</li></li></ul><li>So what technology has Yahoo! opened?<br /><ul><li>YUI – Yahoo! User Interface
  21. Design and develop for the user, not for the browser
  22. Reset the browser CSS styles so all browsers have similar layout behaviour
  23. Change the fonts so that they look the same cross-browser using percentage sizes (no more excuses for hard-coding font sizes!).
  24. Use CSS grids – its just too hard to do it any other way: http://developer.yahoo.com/yui/grids/builder/
  25. YUI Controls/Widgets include Calendar, Module, DataTable, etc: http://developer.yahoo.com/yui/calendar/</li></li></ul><li>So what technology has Yahoo! opened?<br /><ul><li>BOSS (Build your own search service)
  26. Currently unlimited access to websearch API</li></li></ul><li>So what technology has Yahoo! opened?<br /><ul><li>Flickr
  27. Most used photo API worldwide
  28. http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=88dfe8282b22644fe806fa33018a3f50&user_id=31508066%40N00&text=new+zealand</li></li></ul><li>So what technology has Yahoo! opened?<br /><ul><li>Maps</li></ul>&lt;script type=&quot;text/javascript” src=&quot;http://api.maps.yahoo.com/ajaxymap?v=3.8&appid=hyBP5mDV34EiUpuYzxFAd5s2dTxQ4ioG3SKT2Yl6r1bo918ZTfj59aJ3UaRf61gNUvGKzdoeTQ--&quot;&gt;&lt;/script&gt;<br />&lt;div id=&quot;map&quot;&gt;&lt;/div&gt;<br />&lt;script type=&quot;text/javascript&quot;&gt;<br />var map = new YMap(document.getElementById(&apos;map&apos;));<br />map.addTypeControl();<br />map.addZoomLong();<br />map.setMapType(YAHOO_MAP_REG);<br /> map.drawZoomAndCenter(&quot;242, Queen St, Auckland, New Zealand&quot;, 3);<br />&lt;/script&gt;<br />
  29. So what technology hasn’t Yahoo! opened?<br />
  30. YQL – the glue that mashes the APIs together<br /><ul><li>YQL
  31. select * from internets
  32. Is a command-line language to get data from APIs
  33. Is a RESTful interface, returning XML or JSON
  34. Can be used with server-side HTTP requests or json function callbacks (for javascript client-side HTTP requests).
  35. select {what} from {service} where {condition}</li></li></ul><li>YQL – simple RSS feed example<br /><ul><li>Let’s take a normal RSS feed
  36. http://nz.rss.news.yahoo.com/top_stories.xml
  37. And search the descriptions for a keyword
  38. SELECT title, url, description </li></ul>FROM rss<br />WHERE url=&apos;http://nz.rss.news.yahoo.com/top_stories.xml’<br />AND description like &apos;%the%’<br /><ul><li>Let’s take a look at the web-based console…</li></li></ul><li>YQL – What’s going on in the world right now?<br /><ul><li>The description of the first item of the top stories RSS feed should give us some text that describes what is newsworthy right now</li></ul>select description from rss<br />where url=&quot;http://nz.rss.news.yahoo.com/top_stories.xml&quot; <br />limit 1<br />
  39. YQL – What’s going on in the world right now?<br /><ul><li>Finding some key terms from the textual description
  40. We use an IN clause to use the result of 1 API into the input of another API
  41. Best demonstrated with an example:</li></ul>select content from search.termextract where context in (<br />select description from rss<br />where url=&quot;http://nz.rss.news.yahoo.com/top_stories.xml&quot; <br />limit 1<br />)<br />
  42. YQL – What’s going on in the world right now?<br /><ul><li>So now we have some keywords about what’s going on the news right now
  43. What if we used that data to get the other related news going on in the world</li></ul>select * from search.news wherequery in (<br />select content from search.termextract where context in (<br />select description from rss<br />where url=&quot;http://nz.rss.news.yahoo.com/top_stories.xml&quot; <br />limit 1<br />)<br />)<br />
  44. YQL – What’s going on in the world right now?<br /><ul><li>There’s more we can do with those keywords
  45. Let’s get web search results too:</li></ul>select * from search.web where query in (<br />select content from search.termextract where context in (<br />select description from rss<br />where url=&quot;http://nz.rss.news.yahoo.com/top_stories.xml&quot; <br />limit 1<br />)<br />)<br />
  46. YQL – What’s going on in the world right now?<br /><ul><li>There’s even more we can do with those keywords
  47. Let’s get flickr results too:</li></ul>select * from flickr.photos.search where text in (<br />select content from search.termextract where context in (<br />select description from rss<br />where url=&quot;http://nz.rss.news.yahoo.com/top_stories.xml&quot; <br />limit 1<br />)<br />)<br />
  48. YQL – so how do we programmatically use this data?<br /><ul><li>Example PHP code – fetching the data
  49. Using CURL to make a server-side web request</li></ul>&lt;?php<br />$ch = curl_init(“http://query.yahooapis.com/v1/public/yql?q=select…&format=json”);<br />curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);<br />$jsonContent = curl_exec($ch);<br />curl_close($ch);<br />$content = json_decode($jsonContent);<br />?&gt;<br />
  50. YQL – so how do we programmatically use this data?<br /><ul><li>Example PHP code – displaying the data
  51. Not exactly rocket science:</li></ul>&lt;?php<br />echo(‘&lt;ul&gt;’);<br />foreach ($content[‘results’] as $result) {<br /> $url = $result[‘clickurl’];<br /> $title = $result[‘title’];<br /> echo(“&lt;li&gt;&lt;a href=”$url”&gt;$title&lt;/a&gt;&lt;/li&gt;”);<br />}<br />echo(‘&lt;/ul&gt;’);<br />?&gt;<br />
  52. YQL – so how do we use this data?<br />function SimpleSearch(searchResultsDivId) {<br />this.searchResultsOL = document.getElementById(searchResultsDivId);<br />this.display = function(o) {<br />varinnerHTML = &apos;&apos;;<br />varresults = o.query.results.result;<br /> for (i in results) {<br />varresult = results[i];<br />innerHTML = innerHTML + &apos;&lt;li&gt;&lt;a href=&quot;&apos; + result.clickurl + &apos;&quot;&gt;&apos; +<br />result.title + &apos;&lt;/a&gt;&lt;br /&gt;’ + result.abstract + &apos;&lt;/li&gt;&apos;;<br /> }<br />this.searchResultsOL.innerHTML = innerHTML;<br /> }<br />}<br />
  53. YQL – so how do we programmatically use the data from YQL?<br /><ul><li>Example Javascriptcode
  54. We can then define an object of SimpleSearch:</li></ul>&lt;script&gt;<br />varwebSearch = new SimpleSearch(“html_list_container”);<br />&lt;/script&gt;<br /><ul><li>Using Javascript we can get the browser to make the HTTP request:</li></ul>&lt;script src=&quot;http://query.yahooapis.com/v1/public/yql?q=select…&format=json&callback=webSearch.display&quot;&gt;&lt;/script&gt;<br /><ul><li>That results in a call to object instance webSearch, method display with the json data from YQL.</li></li></ul><li>YQL – A real live example – I’m nervous, are you?<br /><ul><li>What’s going on the world right now?
  55. News, Web and Flickr results
  56. From 3 YQL queries
  57. Using JSON callbacks
  58. All HTTP requests done by the browser
  59. No server-side processing
  60. …here we go…</li></li></ul><li>YQL – Table List<br />
  61. YQL – Table List<br />
  62. YQL – what else can you do?<br /><ul><li>Using XPath, you can get content from a HTML page or any published feed:
  63. This gets all main navigation items from the herald:</li></ul>select * from html<br />where url=&apos;http://www.nzherald.co.nz&apos;<br />and xpath=&apos;//h2/a&apos;<br />
  64. YQL – what else can you do?<br /><ul><li>Using open tables, you can create your own data tables to use in your own query (and mash up with other people’s data).
  65. Programmatically handle select statements on your open data using server-side javascript code. </li></li></ul><li>YQL – developing with YQL<br /><ul><li>Good practice
  66. Your YQL query is cached for you by Yahoo! infrastructure
  67. However, especially if your servers are in New Zealand, caching local to your server is important for scale and performance
  68. Caching is also important to avoid hitting Yahoo!’s limit of 100,000 per application ID per day
  69. Test using the console, and copy the REST query into your scripting language of choice (PHP) or use the javascript JSON callback.</li></li></ul><li>YQL – Summary<br /><ul><li>YQL is a very quick and easy way to get data to your fingertips
  70. Mash up a huge variety of data including APIs, contributed open tables, your own tables and any publically available feed or webpage
  71. Use Yahoo! data, don’t use Yahoo! data – up to you.
  72. Just have fun!</li></li></ul><li>THANKS!<br />© 2007 Yahoo!7 Pty Limited<br />Leave your details with Alison to be contacted for future events, including being the first to know about our NZ Hackday competition.<br />

×