BOSS (Build your Own Search Service) is Yahoo's new open search platform. Using the BOSS API, developers have access to Yahoo's entire search index to create custom searches, mashups, and more. Read more about it here.
A practical (and simple) use for BOSS is to build a custom search page so that users can search your website. I wrote a simple search page to do this using PHP with the CURL extension.
Let's take a look at the steps needed to execute a simple site search with BOSS and PHP:
- Get a query from a user (web form).
- Build the BOSS query URL with your Yahoo AppID and other parameters.
- Submit the query to BOSS (using a CURL GET request)
- Receive the XML (or JSON) data from BOSS.
- Parse the XML and display the results.
Try out the search here.
View the code here (formatted).
Download the code here (text).
UPDATED: Added support for multiple result pages.
