Google::Ranker - Find the ranking of a site/result against a search
Version 0.02
use Google::Ranker; my $rank = Google::Ranker->rank("search.cpan.org", { q => "perl network", key => ..., referer => ... }); # (Make sure to get a valid key and referer from http://code.google.com/apis/ajaxsearch/signup.html first) # Or pass in a prepared search: my $search = Google::Search->Local(...); my $rank = Google::Ranker->rank("example.com", $search); # You can also rank against different criteria: my $search = Google::Search->Video(q => "tay zonday", ...); my $rank = Google::Ranker->rank(sub { $_[0]->titleNoFormatting =~ m/Chocolate Rain/i }, $search);
Google::Ranker will determine the rank of a result matching some criteria within a search. The search can be done on any of Google's search services, including web, local, news, blogs, images, videos, and books.
This connects to Google's AJAX Search API (http://code.google.com/apis/ajaxsearch/) and is built upon Google::Search
Returns the numeric rank for <match> in <search>
Returns undef if <match> is not found (very possible, since the Google AJAX API only returns a limited number of results at this time)
The first result from Google is ranked at 1
The parameter <match> can either be a string converted into a regular expression, a regular expression to be matched against the uri of each result, or a code reference passed each result (in turn) as the first parameter.
The parameter <search> should be a Google::Search or a hash reference to be passed to Google::Search->new(...)
At minimum you must pass in a key, a referer, and a q (the actual query)
key
referer
q
Robert Krimen, <rkrimen at cpan.org>
<rkrimen at cpan.org>
Google::Search
Please report any bugs or feature requests to bug-google-ranker at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Google-Ranker. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-google-ranker at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Google::Ranker
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Google-Ranker
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Google-Ranker
CPAN Ratings
http://cpanratings.perl.org/d/Google-Ranker
Search CPAN
http://search.cpan.org/dist/Google-Ranker
Copyright 2008 Robert Krimen, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Google::Ranker, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Google::Ranker
CPAN shell
perl -MCPAN -e shell install Google::Ranker
For more information on module installation, please visit the detailed CPAN module installation guide.