Why Teams call analytics are critical to your entire business
How to Build a Yahoo! SearchMonkey App
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. PART I: Mash Maker + SearchMonkey = Using Intel's Mash Maker to make Yahoo! SearchMonkey Custom Data Services.
3.
4.
5. 3. Click "Pick from Page" and then select an element on the page to extract . The "Pick from Page" button is conveniently located here
6.
7. 5. Save your extractor 1. Give your Extractor a name (like "Pitchfork Review Extractor") 2. Click "Types" and select the type of page this is (like "review") 3. Save your work by clicking publish.
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 "Publish". c. When you've extracted all the elements that you want… CLICK THE MONKEY ! !!
9. 7. Save the Mash Maker data to your clipboard. Click "copy to clipboard"
10. 8. In a new window, open the SearchMonkey application dashboard: http://developer.yahoo.com/searchmonkey/ Click "Build an App"
11. 9. Create a new Custom Data Service a. Scroll down and create a new "Custom Data Service" b. Fill out the following "Basic Info" and "URLs" pages.
12. 10. Paste the Mash Maker code into the box in the middle of the Data Extraction page
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. 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.
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.
22.
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 "Appearance" page is set up to create a SearchMonkey Enhanced Result like the one below.
24. Step 4: Appearance (cont’d) Infobar Infobar: If you are using a Custom Data Service, you MUST select "Infobar" 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.
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 ( http://www.yahoo.com/ ) 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 "happy link", and click publish. 2. To extract the URL (href), repeat step one and name this property something like "happy link url". 3. Check the “Expert” box. 4. Add “/@href” to the end of the string in the “XPath” text box.
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 www.foodnetwork.com ): /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: ‘ http://www.foodnetwork.com’ . Data::get('smid:gfx/mm:recipe_courtesy_href'); 3. Then add the ‘trim’ function like this: ‘ http://www.foodnetwork.com’ . trim(Data::get('smid:gfx/mm:recipe_courtesy_href'));