-
-
09 Mar 2011 22:05:10 UTC
- Development release
- Distribution: WebService-Blekko
- Module version: 1.00_07
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues
- Testers (38 / 60 / 0)
- Kwalitee
Bus factor: 0- 56.91% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (11.31KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
and 1 contributors-
Greg Lindahl
- Dependencies
- Data::Dumper
- HTTP::Request
- JSON
- LWP::UserAgent
- List::Util
- Test::More
- Time::HiRes
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
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.
Module Install Instructions
To install WebService::Blekko, copy and paste the appropriate command in to your terminal.
cpanm WebService::Blekko
perl -MCPAN -e shell install WebService::Blekko
For more information on module installation, please visit the detailed CPAN module installation guide.