Joseph Wilk

Joseph Wilk

Things with code, creativity and computation.

Rboss RubyGem for Yahoo! Search BOSS

With Search BOSS (Build your Own Search Service) Yahoo has freed up a lot of the restrictions on their previous search service. Like removing the cap on the number of searches and allowing re-purposing of results. I’ve been doing some work on using the service in Ruby. I wrote a little RubyGem called Rboss which wraps around the BOSS webservice. It makes life nice and easy using Ruby and BOSS.

require 'rubygems'
require 'boss'

api = Boss::Api.new('boss-api-key-got-from-yahoo')

#Find news articles that are not older than 7 days
results = api.search_news('monkeys', :age => '7d')
results.each do |news|
   puts news.title
   puts news.abstract
   puts news.date
   puts news.url
end

Install Gem from GitHub:

  1. Add github to gem sources

    gem sources -a http://gems.github.com

  2. Install the gem:

    sudo gem install eshopworks-rboss

  3. If you don’t already have a BOSS api key signup for one: http://developer.yahoo.com/wsregap

Checkout the Rboss documentation and example usage at: http://github.com/eshopworks/rboss-gem

Thanks to eShopworks for sponsoring this project.

Comments