BOSSMan: Build Your Own Search Engine With Yahoo And Ruby

By Peter Cooper

Recently, Yahoo! launched BOSS - the "Build Your Own Search Service." In all but name, it appears very similar to their older Yahoo! Search API, as it allows you to query Yahoo's search index programatically. Under the surface though, Yahoo has removed the 5,000 query per day limit, you're unrestricted in how you present the data returned, you can re-order the data, and no attribution is required.

For Rubyists ready to play with BOSS, Jay Pignata has developed BOSSMan, a library for interacting with the Yahoo! BOSS Web service. Either get it with Git or install with RubyGems like so:

gem sources -a http://gems.github.com gem install jpignata-bossman

Once you've got the library, make sure you've got an application ID from Yahoo (this is unavoidable, alas) and then you can start to play:

require ' rubygems ' require ' bossman ' include BOSSMan BOSSMan . application_id = " Your Application ID here " news = BOSSMan :: Search . news (" Barack Obama ", 0 , 3 ) news . results . each do | result | puts " #{result.title} [from #{result.source} ] " end

BOSSMan supports Web, news, and image searches out of the box. You can dump to JSON, XML, or YAML and access all of the relevant attributes through methods. Superb!