++ed by:
ADAMJS

1 PAUSE user

Runar Buvik
and 1 contributors

NAME

WebService::Yahoo::BOSS - Interface to the Yahoo BOSS Search API

SYNOPSIS

    use WebService::Yahoo::BOSS;

    $boss = WebService::Yahoo::BOSS->new( ckey => $ckey, csecret => $csecret );

    $response = $boss->Web( q => 'microbrew award winner 2010', ... );

    $response = $boss->PlaceFinder( q => 'Fleet Street, London', ... );

    
    foreach my $result (@{ $response->results }) {
        print $result->title, "\n";
    }

DESCRIPTION

Provides an interface to the Yahoo BOSS (Build Your Own Search) web service API.

Mad props to Yahoo for putting out a premium search api which encourages innovative use.

This is a work in progress, so patches welcome!

Interaction

Each service has a corresponding method call. The call takes the same parameters as described in the Yahoo BOSS documentation.

Each method returns a WebService::Yahoo::BOSS::Response object that has the following methods:

    $response->totalresults; # total number of available results
    $response->count;        # number of results in this set
    $response->start;        # typically same as start argument in request
    $response->results;      # reference to array of result objects

The result objects accessed via the results methods are instances of a WebService::Yahoo::BOSS::Response::* class that corresponds to the method called.

METHODS

new

    $boss = WebService::Yahoo::BOSS->new(

        # required
        ckey => $ckey,
        csecret => $csecret,

        # optional
        url => 'http://yboss.yahooapis.com',
        ua => LWP::UserAgent->new(...),
    );

Web

Yahoo web search index results with basic url, title, and abstract data.

    $response = $boss->Web( q       => 'microbrew award winner 2010',
                            start   => 0,
                            exclude => 'pilsner', );

For more information about the arguments and result attributes see http://developer.yahoo.com/boss/search/boss_api_guide/webv2_service.html

The results are WebService::Yahoo::BOSS::Response::Web objects.

Images

Image search. Image Search includes images from the Yahoo Image Search index and Flickr.

    $response = $boss->Images( q       => 'microbrew award winner 2010',
                            start   => 0,
                            exclude => 'pilsner', );

For more information about the arguments and result attributes see https://developer.yahoo.com/boss/search/boss_api_guide/image.html

The results are WebService::Yahoo::BOSS::Response::Images objects.

PlaceFinder

    $response = $boss->PlaceFinder(
        q => '701 First Ave., Sunnyvale, CA 94089',
    );

For more information about the arguments and result attributes see http://developer.yahoo.com/boss/geo/docs/requests-pf.html

The results are WebService::Yahoo::BOSS::Response::PlaceFinder objects.

SEE ALSO

http://developer.yahoo.com/search/boss/boss_api_guide

Google::Search

SOURCE CODE

Development version of the source code is available at https://github.com/runarbu/WebService-Yahoo-BOSS. Patches are welcome.

AUTHOR

"Fred Moyer", <fred@slwifi.com>

The PlaceFinder service, and general refactoring and optimization, by Tim Bunce. Image search by Runar Buvik.

COPYRIGHT AND LICENSE

Copyright (C) 2011 by Silver Lining Networks

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.