+ All Categories
Home > Technology > Yahoo! BOSS in Bucharest

Yahoo! BOSS in Bucharest

Date post: 21-Jan-2015
Category:
Upload: ted-drake
View: 1,515 times
Download: 2 times
Share this document with a friend
Description:
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.
Popular Tags:
22
BOSS Power Ted DRAKE Yahoo! France Bucharest, Romania 6-7/11/2008
Transcript
Page 1: Yahoo! BOSS in Bucharest

BOSS PowerTed DRAKE

Yahoo! FranceBucharest, Romania 6-7/11/2008

Page 2: Yahoo! BOSS in Bucharest

Brief intro•I joined Yahoo! in 2005 to work on the

first major mash up in web 2.0: Yahoo! Tech

•I have worked on Answers, Finance, Canadian Finance, Global Finance, Platforms, Accessibility Stakeholders Group, IE7 Task Force, and International Yahoo! Developer Network.

•I studied fine arts, not computer science.

Page 3: Yahoo! BOSS in Bucharest

BOSS Basics

Exactly the same as other search APIs

Only completely different!

Page 4: Yahoo! BOSS in Bucharest

BOSS Basics•Free

•No rate limit

•Freedom

MashChange the rankingChange the design

Keep Yahoo! a secretCache and store

results

Use Google APIs

Cross check with Digg

News, Web, Image, Spelling suggestionsGrab user info from Facebook

Flickr Images

Creative Commons

search

Page 5: Yahoo! BOSS in Bucharest

HACK!

Page 6: Yahoo! BOSS in Bucharest

Search as Engine

•Yahoo! Tech: product category and name used to generate various modules via search on different APIs. (implied query)

•Yahoo! News: Full coverage pages are driven entirely by a search interface (defined query)

Page 7: Yahoo! BOSS in Bucharest

What is the most important part of your application?

•The results display?

•The text ads?

•The rounded borders?

•The smooth animations?

•The perfect URL?

THE QUERY STRING!!!

Page 8: Yahoo! BOSS in Bucharest

The Query

•Tells you what the user is looking for

•Generates related topics

•Powers secondary APIs

•Can be generated by a search box, URL, tags,or keyword extraction from the page.

•The Query is your BFF!

Page 9: Yahoo! BOSS in Bucharest

BOSS Details•REST or SOAP based API. (examples

are REST)

•XML or JSON output

•Web, News, Image, and Spelling Suggestion services

•I18N ready (language, region, UTF-8)

•Recognizes most search filters from Yahoo! and Google (backdoor hacks)

Page 10: Yahoo! BOSS in Bucharest

Site Specific Results

•Search only one site:

/ysearch/web/v1/golf+site:vw.com?

•Search from a select group of sites:

/ysearch/web/v1/golf?sites=vw.com,vwtrendsweb.com,performancevwmag.com,caranddriver.com

Page 11: Yahoo! BOSS in Bucharest

Tag or Title Filters

•Use the inurl: filter to simulate tag search:

/ysearch/web/v1/inurl:golf?

•Use the intitle: filter to filter by results with query in title

/ysearch/web/v1/intitle:golf?

Page 12: Yahoo! BOSS in Bucharest

Get Related Sites

•You can find sites related to each result by triggering secondary queries.

/ysearch/web/v1/related:http://www.caranddriver.com/car/2006-models/2006-golf.html?

Page 13: Yahoo! BOSS in Bucharest

BOSS Key Terms

•Each result will have the categories Yahoo has assigned to the page.

•The categories are listed in order of relevance.

•Official Partners can get more details about the relevance.

•/web/v1/scirocco?format=xml&view=keyterms

Page 14: Yahoo! BOSS in Bucharest

What this allows?

•Each result can have related searches

•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)

•Use these quality tags for secondary APIs

Page 15: Yahoo! BOSS in Bucharest

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>

Page 16: Yahoo! BOSS in Bucharest

BOSS Mashup Framework

•Perl based framework to mash BOSS API with secondary web services and proprietary data

•“Easy” to hookup to Google APP Engine (I could never get past the Google signup procedure)

•Powers the infamous YUIL (4 hour search) project.

Page 17: Yahoo! BOSS in Bucharest

Lessons Learned

•Don’t forget to declare UTF-8 encoding on the page: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

Page 18: Yahoo! BOSS in Bucharest

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);

Page 19: Yahoo! BOSS in Bucharest

Users are Evil•Don’t open your site to Cross Site

Scripting.

•Never trust your users.

•Never display unfiltered User Generated Content!

•This includes query params generated by radio buttons and checkboxes!

Page 20: Yahoo! BOSS in Bucharest

Tips for Safety

•encode your Query when creating page title, pagination links, “You searched for...”

$niceQuery = htmlentities($_REQUEST['query']);

$safeQuery = urlencode($_REQUEST['query']);

• Is $_REQUEST[‘page’] a digit?

• Use two letter language descriptions, i.e. en, fr, ro. Test the string length of $_REQUEST[‘lang’]

• Always test your incoming variables.

Page 21: Yahoo! BOSS in Bucharest

Extra Goodies

•Use Pipes.Yahoo.Com to handle your web service mashups. It handles multi-curl, caching, and returns XML, JSON, or PHP array

•Get around any BOSS limitations by using YQL – REST Post, more queries, etc.


Recommended