Google::Ranker - Find the ranking of a site/result against a search


Google-Ranker documentation  | view source Contained in the Google-Ranker distribution.

Index


NAME

Top

Google::Ranker - Find the ranking of a site/result against a search

VERSION

Top

Version 0.02

SYNOPSIS

Top

    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);

DESCRIPTION

Top

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

METHODS

Top

Google::Rank->rank( <match>, <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)

AUTHOR

Top

Robert Krimen, <rkrimen at cpan.org>

SEE ALSO

Top

Google::Search

BUGS

Top

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.

SUPPORT

Top

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

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top


Google-Ranker documentation  | view source Contained in the Google-Ranker distribution.