Yahoo xtra Open Technolgies

  • 1,919 views
Uploaded on

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

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

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

Views

Total Views
1,919
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
36
Comments
0
Likes
3

Embeds 0

No embeds

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. Yahoo! Open Strategy – focus on YQL
    Neil Wilkinson (Wilf)
    Technical Director, Yahoo!7 and Yahoo!Xtra
    2nd July 2009
    © 2007 Yahoo!7 Pty Limited
  • 2. Who am I and what am I doing here?
    • 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.
  • Who am I and what am I doing here?
    • 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.
  • Yahoo! believes in “open”
    • 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
  • So what technology has Yahoo! opened?
    • 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/
  • So what technology has Yahoo! opened?
    • BOSS (Build your own search service)
    • 26. Currently unlimited access to websearch API
  • So what technology has Yahoo! opened?
    • 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
  • So what technology has Yahoo! opened?
    • Maps
    <script type="text/javascript” src="http://api.maps.yahoo.com/ajaxymap?v=3.8&appid=hyBP5mDV34EiUpuYzxFAd5s2dTxQ4ioG3SKT2Yl6r1bo918ZTfj59aJ3UaRf61gNUvGKzdoeTQ--"></script>
    <div id="map"></div>
    <script type="text/javascript">
    var map = new YMap(document.getElementById('map'));
    map.addTypeControl();
    map.addZoomLong();
    map.setMapType(YAHOO_MAP_REG);
    map.drawZoomAndCenter("242, Queen St, Auckland, New Zealand", 3);
    </script>
  • 29. So what technology hasn’t Yahoo! opened?
  • 30. YQL – the glue that mashes the APIs together
    • 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}
  • YQL – simple RSS feed example
    • 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
    FROM rss
    WHERE url='http://nz.rss.news.yahoo.com/top_stories.xml’
    AND description like '%the%’
    • Let’s take a look at the web-based console…
  • YQL – What’s going on in the world right now?
    • The description of the first item of the top stories RSS feed should give us some text that describes what is newsworthy right now
    select description from rss
    where url="http://nz.rss.news.yahoo.com/top_stories.xml"
    limit 1
  • 39. YQL – What’s going on in the world right now?
    • 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:
    select content from search.termextract where context in (
    select description from rss
    where url="http://nz.rss.news.yahoo.com/top_stories.xml"
    limit 1
    )
  • 42. YQL – What’s going on in the world right now?
    • 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
    select * from search.news wherequery in (
    select content from search.termextract where context in (
    select description from rss
    where url="http://nz.rss.news.yahoo.com/top_stories.xml"
    limit 1
    )
    )
  • 44. YQL – What’s going on in the world right now?
    • There’s more we can do with those keywords
    • 45. Let’s get web search results too:
    select * from search.web where query in (
    select content from search.termextract where context in (
    select description from rss
    where url="http://nz.rss.news.yahoo.com/top_stories.xml"
    limit 1
    )
    )
  • 46. YQL – What’s going on in the world right now?
    • There’s even more we can do with those keywords
    • 47. Let’s get flickr results too:
    select * from flickr.photos.search where text in (
    select content from search.termextract where context in (
    select description from rss
    where url="http://nz.rss.news.yahoo.com/top_stories.xml"
    limit 1
    )
    )
  • 48. YQL – so how do we programmatically use this data?
    • Example PHP code – fetching the data
    • 49. Using CURL to make a server-side web request
    <?php
    $ch = curl_init(“http://query.yahooapis.com/v1/public/yql?q=select…&format=json”);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $jsonContent = curl_exec($ch);
    curl_close($ch);
    $content = json_decode($jsonContent);
    ?>
  • 50. YQL – so how do we programmatically use this data?
    • Example PHP code – displaying the data
    • 51. Not exactly rocket science:
    <?php
    echo(‘<ul>’);
    foreach ($content[‘results’] as $result) {
    $url = $result[‘clickurl’];
    $title = $result[‘title’];
    echo(“<li><a href=”$url”>$title</a></li>”);
    }
    echo(‘</ul>’);
    ?>
  • 52. YQL – so how do we use this data?
    function SimpleSearch(searchResultsDivId) {
    this.searchResultsOL = document.getElementById(searchResultsDivId);
    this.display = function(o) {
    varinnerHTML = '';
    varresults = o.query.results.result;
    for (i in results) {
    varresult = results[i];
    innerHTML = innerHTML + '<li><a href="' + result.clickurl + '">' +
    result.title + '</a><br />’ + result.abstract + '</li>';
    }
    this.searchResultsOL.innerHTML = innerHTML;
    }
    }
  • 53. YQL – so how do we programmatically use the data from YQL?
    • Example Javascriptcode
    • 54. We can then define an object of SimpleSearch:
    <script>
    varwebSearch = new SimpleSearch(“html_list_container”);
    </script>
    • Using Javascript we can get the browser to make the HTTP request:
    <script src="http://query.yahooapis.com/v1/public/yql?q=select…&format=json&callback=webSearch.display"></script>
    • That results in a call to object instance webSearch, method display with the json data from YQL.
  • YQL – A real live example – I’m nervous, are you?
    • 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…
  • YQL – Table List
  • 61. YQL – Table List
  • 62. YQL – what else can you do?
    • Using XPath, you can get content from a HTML page or any published feed:
    • 63. This gets all main navigation items from the herald:
    select * from html
    where url='http://www.nzherald.co.nz'
    and xpath='//h2/a'
  • 64. YQL – what else can you do?
    • 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.
  • YQL – developing with YQL
    • 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.
  • YQL – Summary
    • 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!
  • THANKS!
    © 2007 Yahoo!7 Pty Limited
    Leave your details with Alison to be contacted for future events, including being the first to know about our NZ Hackday competition.