Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Yahoo! BOSS in Bucharest


Published on

This presentation was given to some brilliant students in Bucharest who were working on various projects. It describes the basic features of Yahoo! BOSS as well as how to use a search API to build complete web sites and applications.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Yahoo! BOSS in Bucharest

  1. 1. BOSS Power <ul><li>Ted DRAKE </li></ul><ul><li>Yahoo! France </li></ul><ul><li>Bucharest, Romania 6-7/11/2008 </li></ul>
  2. 2. Brief intro <ul><li>I joined Yahoo! in 2005 to work on the first major mash up in web 2.0: Yahoo! Tech </li></ul><ul><li>I have worked on Answers, Finance, Canadian Finance, Global Finance, Platforms, Accessibility Stakeholders Group, IE7 Task Force, and International Yahoo! Developer Network. </li></ul><ul><li>I studied fine arts, not computer science. </li></ul>
  3. 3. BOSS Basics Exactly the same as other search APIs Only completely different!
  4. 4. BOSS Basics <ul><li>Free </li></ul><ul><li>No rate limit </li></ul><ul><li>Freedom </li></ul>Mash Change the ranking Change the design Keep Yahoo! a secret Cache and store results Use Google APIs Cross check with Digg News, Web, Image, Spelling suggestions Grab user info from Facebook Flickr Images Creative Commons search
  5. 5. HACK!
  6. 6. Search as Engine <ul><li>Yahoo! Tech: product category and name used to generate various modules via search on different APIs. (implied query) </li></ul><ul><li>Yahoo! News: Full coverage pages are driven entirely by a search interface (defined query) </li></ul>
  7. 7. What is the most important part of your application? <ul><li>The results display? </li></ul><ul><li>The text ads? </li></ul><ul><li>The rounded borders? </li></ul><ul><li>The smooth animations? </li></ul><ul><li>The perfect URL? </li></ul>THE QUERY STRING!!!
  8. 8. The Query <ul><li>Tells you what the user is looking for </li></ul><ul><li>Generates related topics </li></ul><ul><li>Powers secondary APIs </li></ul><ul><li>Can be generated by a search box, URL, tags,or keyword extraction from the page. </li></ul><ul><li>The Query is your BFF! </li></ul>
  9. 9. BOSS Details <ul><li>REST or SOAP based API. (examples are REST) </li></ul><ul><li>XML or JSON output </li></ul><ul><li>Web, News, Image, and Spelling Suggestion services </li></ul><ul><li>I18N ready (language, region, UTF-8) </li></ul><ul><li>Recognizes most search filters from Yahoo! and Google (backdoor hacks) </li></ul>
  10. 10. Site Specific Results <ul><li>Search only one site: /ysearch/web/v1/golf ? </li></ul><ul><li>Search from a select group of sites: /ysearch/web/v1/golf?,,, </li></ul>
  11. 11. Tag or Title Filters <ul><li>Use the inurl: filter to simulate tag search: /ysearch/web/v1/ inurl:golf ? </li></ul><ul><li>Use the intitle: filter to filter by results with query in title /ysearch/web/v1/ intitle:golf ? </li></ul>
  12. 12. Get Related Sites <ul><li>You can find sites related to each result by triggering secondary queries. /ysearch/web/v1/ related: ? </li></ul>
  13. 13. BOSS Key Terms <ul><li>Each result will have the categories Yahoo has assigned to the page. </li></ul><ul><li>The categories are listed in order of relevance. </li></ul><ul><li>Official Partners can get more details about the relevance. </li></ul><ul><li>/web/v1/scirocco?format=xml& view=keyterms </li></ul>
  14. 14. What this allows? <ul><li>Each result can have related searches </li></ul><ul><li>Create an array of all related tags and display the most common at the top of the page (this is what powers the search suggestions on Yahoo! Search) </li></ul><ul><li>Use these quality tags for secondary APIs </li></ul>
  15. 15. What it looks like <keyterms> <terms> <term>Bucharest</term> <term>city</term> <term>Romanian</term> <term>population</term> <term>Romania</term> <term>architecture</term> <term>city centre</term> <term>clubs</term> </terms> </keyterms>
  16. 16. BOSS Mashup Framework <ul><li>Perl based framework to mash BOSS API with secondary web services and proprietary data </li></ul><ul><li>“Easy” to hookup to Google APP Engine (I could never get past the Google signup procedure) </li></ul><ul><li>Powers the infamous YUIL (4 hour search) project. </li></ul>
  17. 17. Lessons Learned <ul><li>Don’t forget to declare UTF-8 encoding on the page: <meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8 &quot;> </li></ul>
  18. 18. Let PHP do the messy work BOSS requires url encoding of the request. Use the http_build_query() function $qrystrarray = array( 'sites' => $Site, 'appid' => $Appid, 'format' => 'xml', 'start' => $start, 'count' => '15');$qryString = http_build_query($qrystrarray);
  19. 19. Users are Evil <ul><li>Don’t open your site to Cross Site Scripting. </li></ul><ul><li>Never trust your users. </li></ul><ul><li>Never display unfiltered User Generated Content! </li></ul><ul><li>This includes query params generated by radio buttons and checkboxes! </li></ul>
  20. 20. Tips for Safety <ul><li>encode your Query when creating page title, pagination links, “You searched for...” $niceQuery = htmlentities($_REQUEST['query']); $safeQuery = urlencode($_REQUEST['query']); </li></ul><ul><li>Is $_REQUEST[‘page’] a digit? </li></ul><ul><li>Use two letter language descriptions, i.e. en, fr, ro. Test the string length of $_REQUEST[‘lang’] </li></ul><ul><li>Always test your incoming variables. </li></ul>
  21. 21. Extra Goodies <ul><li>Use Pipes.Yahoo.Com to handle your web service mashups. It handles multi-curl, caching, and returns XML, JSON, or PHP array </li></ul><ul><li>Get around any BOSS limitations by using YQL – REST Post, more queries, etc. </li></ul>
  22. 22. Questions? <ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li>http:// /search/boss </li></ul><ul><li>[email_address] </li></ul>