Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Ruby gem for interacting with Yahoo's BOSS web service
branch: master

This branch is 79 commits behind jpignata:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
samples
LICENSE
README
bossman.gemspec

README

= BOSSMan -- Class for interaction with the Yahoo BOSS web service

== Description

BOSSMan can be used to perform image, web and news searches against Yahoo's index. For more information about BOSS (Build your Own Search Service) please refer to http://developer.yahoo.com/search/boss/. 

== Bugs, Features, Feedback

Feedback would be really appreciated. You can send it to me at john.pignata@gmail.com -- tickets can
be submitted by using Lighthouse: http://pignata.lighthouseapp.com/projects/15761-bossman

== Example Usage

=== Web

	require 'rubygems'
	require 'bossman'
	include BOSSMan

	BOSSMan.application_id = <Your Application ID>

	prospectpark_web = BOSSMan::Search.web("prospect park", 0, 20)

	puts "Number of results: #{madmen_web.totalhits}"
	puts

	prospectpark_web.results.each do |result|
	  puts "#{result.title}"
	  puts "-" * 80
	  puts "#{result.abstract}"
	  puts
	end

=== News

	require 'rubygems'
	require 'bossman'
	include BOSSMan

	BOSSMan.application_id = <Your Application ID>

	brooklyn_news = BOSSMan::Search.news("brooklyn new york", 0, 20)

	brooklyn_news.results.each do |result|
	  puts "#{result.title} [from #{result.source}]"
	  puts "-" * 80
	  puts "#{result.abstract}"
	  puts
		
=== Images

	require 'rubygems'
	require 'bossman'
	include BOSSMan

	BOSSMan.application_id = <Your Application ID>

	dumbo_images = BOSSMan::Search.images("brooklyn dumbo", 0, 20)

	dumbo_images.results.each do |result|
	  puts "<img src=\"#{result.url}\" alt=\"#{result.abstract}\" /><br />"
	end
	
	
== Output Objects

Assuming an object returned called search:

search = BOSSMan::Search.web("staten island", 0, 20)

=== Common

search.responsecode				: HTTP response code
search.nextpage					: REST URL to next page of search results
search.count					: Number of search results contained in response
search.start					: Search result from which output starts
search.totalhits				: De-duplicated total number of results search yielded
search.deephits					: Total number of results search yielded
search.results[].clickurl		: Tracking URL of result; must be used in user-facing
										anchor tags by BOSS TOU
search.results[].url			: URL of result

=== Web

search.results[].abstract		: Description of result with keywords emboldened
search.results[].title			: Document title with keywords emboldened
search.results[].dispurl		: Display URL of result
search.results[].size			: Size of result in bytes
search.results[].date			: Date result was indexed

=== News

search.results[].abstract		: Description of news story
search.results[].title			: Title of news story
search.results[].language		: Language of news story
search.results[].date			: Last publication date of news story
search.results[].time			: Last publication time of news story
search.results[].source			: Source of news story
search.results[].sourceurl		: URL of source publication

=== Images

search.results[].abstract			: Description of image
search.results[].filename			: Filename of image
search.results[].size				: Size of image
search.results[].format				: Format of image
search.results[].height				: Height of full-size image
search.results[].date				: Last modification date of image (YYYY/MM/DD)
search.results[].mimetype			: MIME type of image
search.results[].refererclickurl	: Link to page where image was found
search.results[].refererurl 		: Link to page where image was found
search.results[].title				: Title of image (usually the filename)
search.results[].width				: Width of full-size image
search.results[].thumbnailurl		: URL of thumbnail image
search.results[].thumbnail_height	: Height of thumbnail image
search.results[].thumbnail_width    : Width of thumbnail image

=== Raw dump formats

Resultsets are returnable in JSON, XML and YAML by use of to_json, to_xml (or to_s), to_yaml respectively.

search			 			: dumps XML of entire resultset
search.to_json	 			: dumps JSON of entire resultset
search.to_yaml				: dumps YAML of entire resultset
search.results[3]			: dumps XML of one search result
search.results[3].to_json	: dumps JSON of one search result
search.results[3].to_yaml	: dumps YAML of one search result

== Installation

   jp@populuxe:~/code/ruby$ gem sources -a http://gems.github.com
   jp@populuxe:~/code/ruby$ gem install jpignata-bossman

== Requirements

* Active Support >= 2.1

== LICENSE:

(The MIT License)

Copyright (c) 2008 Jay Pignata

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Something went wrong with that request. Please try again.