Greg Lindahl > WebService-Blekko > WebService::Blekko

Download:
WebService-Blekko-1.00_07.tar.gz

Dependencies

Annotate this POD

Module Version: 1.00_07   Source  

NAME ^

WebService::Blekko - access the Blekko JSON APIs

SYNOPSIS ^

 use WebService::Blekko;

 my $blekko = WebService::Blekko->new( auth => 'webservice-blekko-example', );

 $res = $blekko->query( "obama /date" );

 if ( $res->error ) { ... }

 while ( my $r = $res->next ) {
    print $r->url, $r->title; # etc.
 }

DESCRIPTION ^

 This API wraps the Blekko search engine API(s). You can query for results,
 manipulate slashtags, get tool-bar-useful information, and so forth.

 For the Terms and Conditions for using Blekko data, please see

 https://blekko.com/ws/+/terms
 and
 https://blekko.com/ws/+/apiterms

 To get an API Auth key, please contact apiauth@blekko.com

METHODS ^

new( %opts )

Options include

 server => server to talk to, defaults to blekko.com
 auth => api auth key, gotten by contacting apiauth@blekko.com
 source => the name of your program/service
 page_size => number of results to return, default 20, max of 100
 scheme => http, defaults to https if available
 qps => API calls per second, defaults to 1. Do not make this greater than 1 without asking.
 agent => the user-agent to be used by LWP::UserAgent. Defaults to the package name_version.

 cookie_jar_file => cookie jar file to use, see LWP::UserAgent
 cookie_jar => cookie jar object to use, see LWP::UserAgent

Additional options are passed to LWP::UserAgent.

query( query_string, %opts )

Queries the server, and returns a WebService::Blekko::QueryResultSet.

Options include page_size (see above) and p, to get the pth page of results, counting from zero.

pagestats( url )

Returns information about a webpage, suitable for toolbar use. Returns a WebService::Blekko::Pagestats object, with methods host_inlinks, host_rank, etc.

login( username, password )

Logs into blekko, which is needed before you create/add to/delete slashtags. Requires a cookie jar file or object to work.

Returns WebService::Blekko::Result, which has methods error, result, and http_code. Check error before using result.

logout()

Logs out of blekko. Does not throw an error if you are already logged out.

user_info()

Returns the username of the currently logged-in user. Useful in toolbars, where the user logs directly into blekko.

create_slashtag( $slashtag, \@urls, $description )

Creates a slashtag.

add_urls( $slashtag, \@urls )

Adds urls to an existing slashtag.

list_urls( $slashtag )

Returns an arrayref of the urls in the slashtag

delete_urls( $slashtag, \@urls )

Deletes urls in a slashtag.

remove_slashtag( $slashtag )

Removes a slashtag.

SEE ALSO ^

 L<WebService::Yahoo::BOSS>, L<Google::Search>

AUTHOR ^

"Greg Lindahl", <greg@blekko.com>

Thanks to Fred Moyer for commenting on the interfaces.

COPYRIGHT AND LICENSE ^

Copyright (C) 2011 by blekko, inc.

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

syntax highlighting: