Yahoo! Search monkey API - CEBIT 2008

download Yahoo! Search monkey API - CEBIT 2008

of 28

  • date post

  • Category


  • view

  • download


Embed Size (px)

Transcript of Yahoo! Search monkey API - CEBIT 2008

Starting to Monkey Around

Starting to Monkey Around With Yahoo! Search MonkeyYoull never make a monkey out of meCEBIT Turkey 2008 ric Daspet
Original presentation by Neil Crosby (One of Yahoo!s Monkeys in London)

Who Am I ?

Frontend engineer at Yahoo!but not in the Search Monkey team

What is Search Monkey?A way to create more interesting Search Results.

Enhanced results and Infobar.

Enhanced results fit a tight template, infobars can be far more freeform.

Some Normal Search Results

Monkey Monkey Monkey!

Where does the data come from?Microformats


Or pull it in from the page using XSLT

My First MonkeyStart with something containing microformats.

FaceBooks public profile pages fit the bill.

Well build a monkey that shows the users profile picture.

Go to

Starting your Monkey Basic InfoName


Category (for gallery)

Icon (really important)

Dont forget to agree to the T&C

URLsUse auto-generate first.

Then choose specific URL for first field.

First URL is used to generate previews in gallery.

Data ServicesWe can ignore this for now since were using formats that are built into Search Monkey.

AppearanceThis is where well actually do some work.

You must change something from the default here.

Using the right hand rail+/- expands/contracts sections.

Clicking an item pastes that data into your PHP at the cursor.

Making our changes$ret['image']['src'] = Data::get('');

And thats all there is to creating a simple monkey!

Let others play with your monkeyOnce youre happy with your monkey, share it.

Let users add your monkey to their SERPs.

Share your source if you want to.

Monkey 2: Robotic Monkey of DoomWe want a Flickr Monkey that:

Shows main/first photo on a page.

Includes relevant information about photo.

No relevant formats on the page, so we need some XSLT.

Will be slower than pre-spidered Formats.

We need to create a data service.

Creating the Data ServiceStarts the same as a Format Monkey does.

Basic Info.


Trigger: **

First test:

Now for some XSLTScary, but not too scary

Be aware of allowable rel values see documentation.

XSLT First PassWe want to extract an image URL and a description.

Assume the only page type is the single photo page for now.

Use Firebug and/or XPather in Firefox to work out XPaths to our required nodes.

XSLT First Pass

Save & RefreshCheck that we dont get any errors.

Then, back to the homepage.

Making our Flickr MonkeyGive it a name

Trigger: **

First Test:

Flickr Monkey Data ServicesAdd More Data Services

Because were using the same URL trigger for monkey and data source, the source shows up here

Flickr Monkey AppearancePoint and click info from the data source.

$ret['summary'] = Data::get('smid:DATA_SRC_ID/rel:Photo/dc:description');

$ret['image']['src'] = Data::get('smid:DATA_SRC_ID/rel:Photo/@resource');

But Flickrs more complex than that!Flickr doesnt just have individual photo pages under **

Also has tag, user, set etc pages.

We should handle this at our end, so users only have to add one monkey.

Enter xsl:chooseAllows if-elseif-else statements in XSL.




Heres one I made earlier (source available)

And were doneTheres lots more you can go away and do.

We havent even looked at infobars.

You can also fiddle with web services.

Theres a whole world of opportunity.

Thankyou.Any questions?

These slides are available at:

(redirects to )