Successfully reported this slideshow.

How to Build a Yahoo! SearchMonkey App


Published on

An easy tutorial on using Intel's Mash Maker to make Yahoo! SearchMonkey apps. SearchMonkey is Yahoo! Search's open developer platform.

Published in: Technology, Design
  • Thank you for sharing !
    Are you sure you want to  Yes  No
    Your message goes here

How to Build a Yahoo! SearchMonkey App

  1. 1. How to build a Yahoo! SearchMonkey App SearchMonkey is Yahoo! Search's open developer platform. Part I : Using Intel's Mash Maker to make a Custom Data Service Part II : Building a Presentation App from your data extractions
  2. 2. PART I: Mash Maker + SearchMonkey = Using Intel's Mash Maker to make Yahoo! SearchMonkey Custom Data Services.
  3. 3. 1. Install Mash Maker <ul><li>Register with a valid email address and download Mash Maker here: </li></ul><ul><li>Check your email and retrieve your login and password. </li></ul><ul><li>In Firefox, enter the login here: 'Tools-> Options -> Mash Maker', and enter your login and password. NOTE: In order for Mash Maker to work with SearchMonkey, YOU MUST BE LOGGED IN. </li></ul>
  4. 4. 2. Navigate to the page from which you want to extract text, pics, etc. <ul><li>Open the Mash Maker tool by clicking here </li></ul>
  5. 5. 3. Click &quot;Pick from Page&quot; and then select an element on the page to extract . The &quot;Pick from Page&quot; button is conveniently located here
  6. 6. 4. Save that element (&quot;property&quot;)‏ <ul><li>Select &quot;Property of the whole page&quot; and click &quot;Add&quot; </li></ul><ul><li>Give it a name. (like &quot;Album Cover&quot;)‏ </li></ul><ul><li>Click &quot;Publish&quot; and you will be prompted to save this set of extractions (extractor). </li></ul><ul><li>NOTE: You must publish all changes for Mash Maker to work properly with SearchMonkey. </li></ul>
  7. 7. 5. Save your extractor 1. Give your Extractor a name (like &quot;Pitchfork Review Extractor&quot;)‏ 2. Click &quot;Types&quot; and select the type of page this is (like &quot;review&quot;)‏ 3. Save your work by clicking publish.
  8. 8. 6. Grab some other elements off of the page and then CLICK THE MONKEY a. For tips on extracting, see the Appendices . b. Save your work by clicking &quot;Publish&quot;. c. When you've extracted all the elements that you want… CLICK THE MONKEY ! !!
  9. 9. 7. Save the Mash Maker data to your clipboard. Click &quot;copy to clipboard&quot;
  10. 10. 8. In a new window, open the SearchMonkey application dashboard: Click &quot;Build an App&quot;
  11. 11. 9. Create a new Custom Data Service a. Scroll down and create a new &quot;Custom Data Service&quot; b. Fill out the following &quot;Basic Info&quot; and &quot;URLs&quot; pages.
  12. 12. 10. Paste the Mash Maker code into the box in the middle of the Data Extraction page
  13. 13. 11. Scroll down and check to see if it worked. Assuming you have the proper URLs in the dashboard, the little preview window should contain a list of your extracted properties. Like this
  14. 14. You're done! Now, that you have a Custom Data Service, you have to start thinking about organizing all that data into a Presentation App. You'll learn all about that in Part II.
  15. 15. Appendix A: Using XPather if Mash Maker isn't working on a particular extraction for some reason <ul><li>If, for some reason, Mash Maker will not extract a particular property, the XPather Firefox add-on is a good back up. </li></ul><ul><li>Install the XPather Firefox add-on: </li></ul><ul><li>In Firefox, right-click on the property you'd like to extract and select &quot;Show in XPather&quot;. Copy the &quot;XPath&quot; in the little window that pops up. </li></ul><ul><li>In the Mash Maker sidebar, highlight the property that isn't working properly and check &quot;Expert&quot;. </li></ul><ul><li>Paste the &quot;XPath&quot; from the XPather window into the &quot;XPath&quot; box in the Mash Maker sidebar. </li></ul>
  16. 16. Appendix B: Links <ul><li>Video tutorial on making Custom Data Services with Mash Maker: </li></ul><ul><li>Video tutorial on extracting with Mash Maker: ( )‏ </li></ul><ul><li>Intel Mash Maker support: </li></ul><ul><li>SearchMonkey apps in the Search Gallery that were created using Mash Maker: </li></ul><ul><ul><li>Food Network: </li></ul></ul><ul><ul><li>How Stuff Works: </li></ul></ul><ul><ul><li> </li></ul></ul><ul><ul><li>Pitchfork Record Reviews: </li></ul></ul><ul><ul><li>GrubHub: </li></ul></ul><ul><ul><li> </li></ul></ul>
  17. 17. Part II: Creating a SearchMonkey Presentation Application
  18. 18. Part II: Building your Presentation Application Step 1: Basic Info <ul><li>Enter name : </li></ul><ul><ul><li>(Choose wisely! This name will appear in the Search Gallery) </li></ul></ul><ul><li>Choose Type </li></ul><ul><ul><li>Select Infobar since you are using a Custom Data Service (only choose “Enhanced Result” if you are NOT using a Custom Data Service.) </li></ul></ul><ul><li>Add description </li></ul><ul><ul><li>will be the description used in the Search Gallery) </li></ul></ul><ul><li>4. Choose the Category that your app best fits under </li></ul><ul><li>5. Get Icon </li></ul><ul><ul><li>add /favicon.ico to end of the root URL of the site you are developing an app for.: </li></ul></ul><ul><ul><li>If this returns an icon, right click on it and save it to your computer ( NOTE: this won't work every time ) </li></ul></ul><ul><ul><li>Click ‘Browse’ and find your icon </li></ul></ul><ul><li>6. Check the Terms of Service box </li></ul><ul><li>7. Click ‘Next Step’ </li></ul>
  19. 19. Part II: Building your Presentation Application Step 2: URLs <ul><li>These URLs should transfer over from your URLs page in your Custom Data Service. </li></ul><ul><li>Follow the instructions under &quot;Create the Trigger URL&quot; </li></ul><ul><li>AND / OR </li></ul><ul><li>Enter the same Trigger URL Pattern from your Custom Data Service. </li></ul><ul><li>2. Click 'AUTOFIND URLs' </li></ul><ul><li>Insert the domains from which your links and images will come. </li></ul><ul><ul><li>You only need to do this if your images and links are hosted on a different URL </li></ul></ul><ul><li>4. Click 'Next Step' </li></ul>
  20. 20. Part II: Building your Presentation Application Step 3: Data Services 1. Click ‘Add More Data Services’ 2. Check the box for the Custom Data Service you just made. 3. Click ‘Next Step’
  21. 21. Part II: Building your Presentation Application Step 4: Appearance <ul><li>On the right side tab, click on ‘smid:’ to open your data service </li></ul><ul><li>2. In the PHP code box, highlight 'SMDEFAULT' under // Image </li></ul><ul><li>Click on the @resource link under (or next to) rel: Photo (or whatever you named your image). </li></ul><ul><ul><li>Code should automatically be pasted in place of the highlighted 'SMDEFAULT' </li></ul></ul><ul><li>4. Click 'Save & Refresh' on bottom of page and the image you extracted should appear in the preview panel. </li></ul>
  22. 22. <ul><li>Continue to add all your @resources to the PHP code SMDEFAULT wherever they fit. </li></ul><ul><ul><li>Deep Links ‏ : </li></ul></ul><ul><ul><ul><li>'Text' = &quot;Link Text&quot; (example: &quot;User Reviews&quot;)‏ </li></ul></ul></ul><ul><ul><ul><li>'href' = The link that you extracted with XSLT in your Custom Data Service. (See Extracting Links )‏ </li></ul></ul></ul><ul><ul><li>Key Value Pairs : </li></ul></ul><ul><ul><ul><li>'Key' = Label Text </li></ul></ul></ul><ul><ul><ul><li>(example: &quot;Address&quot;)‏ </li></ul></ul></ul><ul><ul><ul><li>'Value' = Dynamic Text (example: &quot;1600 Polk Street, San Francisco, CA&quot;)‏ </li></ul></ul></ul><ul><li>When all you've added all the extracted elements that you want to add, click ‘Next Step’. </li></ul><ul><li>NOTE: If you want to make your Infobar more interesting, you can add HTML to the ['infobar']['summary'] section at the bottom of the PHP code box. (See Adding Links to the Infobar ). </li></ul>Part II: Building your Presentation Application Step 4: Appearance (cont)‏
  23. 23. Step 4: Appearance (cont’d) Enhanced Results Key / Value Pairs Key Value Deep Links (up to 4)‏ Star Rating (see Adding Stars )‏ Image Enhanced Result: The default code already in the PHP box on your &quot;Appearance&quot; page is set up to create a SearchMonkey Enhanced Result like the one below.
  24. 24. Step 4: Appearance (cont’d) Infobar Infobar: If you are using a Custom Data Service, you MUST select &quot;Infobar&quot; on Step 1: Basic Info . If you want your infobar to look different from what you get with the default PHP code, you can add your own HTML to the ['infobar']['summary'] and ['infobar']['blob'] section at the bottom of the PHP code box. (See Adding Links to the Infobar )‏ .
  25. 25. Part II: Building your Presentation Application Appendix A – Adding Stars <ul><li>Extract stars as a text resource in your Custom Data Service. (NOTE: Stars should extract as a number in your Custom Data Service preview)‏ </li></ul><ul><li>2. Insert your stars resource as a “Value” in your Key Value Pairs. </li></ul><ul><li>Change the first part of the PHP resource code from “Data::get” to “Data::getStars” </li></ul><ul><li>or </li></ul><ul><li>&quot;Data::getStarsfromNum&quot; </li></ul><ul><li>(use whichever works) </li></ul>
  26. 26. Part II, Appendix B - Extracting Links Adding links to a SearchMonkey module requires extracting the link in two parts: URL and text. When are you add “quick links” to your SM app, the presentation application dashboard has a place to replace the “SMDEFAULT”s with both “text” and “href”, so when you’re making the Custom Data Service, you must extract both text (Yahoo!) and URL ( ) so that you end up with Yahoo! . To extract the text & linked URL of hypertext links:   1. In Mash Maker, first extract the hyperlink's text like you would extract any text, name it something like &quot;happy link&quot;, and click publish. 2. To extract the URL (href), repeat step one and name this property something like &quot;happy link url&quot;. 3. Check the “Expert” box. 4. Add “/@href” to the end of the string in the “XPath” text box.
  27. 27. Part II, Appendix C: Making partial link extractions render in the PHP presentation of your app If, when you try to extract links with Mash Maker, you end up extracting only a partial URL, like this (from ): /saras-secrets/index.html  In order to not get this error message: “Error rendering module. Invalid URL provided for deep links.”, you must take the following steps to make that partial link work in your app: 1. In the PHP presentation portion of the application dashboard, your link extraction will look like this: Data::get('smid:gfx/mm:recipe_courtesy_href'); 2. Add the root URL to the partially extracted URL with the “.” (period) concatenate function: ‘’ . Data::get('smid:gfx/mm:recipe_courtesy_href'); 3. Then add the ‘trim’ function like this: ‘’ . trim(Data::get('smid:gfx/mm:recipe_courtesy_href'));
  28. 28. Building your Presentation Application Part II, Appendix D – Adding Links to the Infobar <ul><li>Insert a new variable to rename your Link data resource (Data::get…) something that will fit in the coming HTML line: </li></ul><ul><li>$orderonlinelink = Data::get… </li></ul><ul><li>Replace the “SMDEFAULT” in the ['infobar']['summary'] line with a PHP friendly HTML link like the one below: </li></ul><ul><li>$ret['infobar']['summary'] = $html.=&quot;<a href='$orderonlinelink'>Order Online</a> </li></ul>