-
-
25 Apr 2006 14:05:03 UTC
- Distribution: WWW-Google-PageRank
- Module version: 0.12
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (0)
- Testers (5 / 0 / 0)
- Kwalitee
Bus factor: 0- License: unknown
- Activity
24 month- Tools
- Download (4.11KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- LWP::UserAgent
- URI::Escape
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
WWW::Google::PageRank - Query google pagerank of page
SYNOPSIS
use WWW::Google::PageRank; my $pr = WWW::Google::PageRank->new; print scalar($pr->get('http://www.yahoo.com/')), "\n";
DESCRIPTION
The
WWW::Google::PageRank
is a class implementing a interface for querying google pagerank.To use it, you should create
WWW::Google::PageRank
object and use its method get(), to query page rank of URL.It uses
LWP::UserAgent
for making request to Google.CONSTRUCTOR METHOD
- $gpr = WWW::Google::PageRank->new(%options);
-
This method constructs a new
WWW::Google::PageRank
object and returns it. Key/value pair arguments may be provided to set up the initial state. The following options correspond to attribute methods described below:KEY DEFAULT ----------- -------------------- agent "Mozilla/4.0 (compatible; GoogleToolbar 2.0.111-big; Windows XP 5.1)" proxy undef host "toolbarqueries.google.com"
agent
specifies the header 'User-Agent' when querying Google. If theproxy
option is passed in, requests will be made through specified poxy.proxy
is the host which serve requests from Googlebar.
QUERY METHOD
- $pr = $gpr->get('http://www.yahoo.com');
-
Queries Google for a specified pagerank URL and returns pagerank. If query successfull, integer value from 0 to 10 returned. If query fails for some reason (google unreachable, url does not begin from 'http://', undefined url passed) it return
undef
.In list context this function returns list from two elements where first is the result as in scalar context and the second is the
HTTP::Response
object (returned byLWP::UserAgent::get
). This can be usefull for debugging purposes and for querying failure details.
BUGS
If you find any, please report ;)
AUTHOR
Yuri Karaban <tech@askold.net>.
Algorithm of computing checksum taken from mozilla module pagerankstatus http://pagerankstatus.mozdev.org by Stephane Queraud <squeraud@toteme.com>.
Algorithm was modified (15-09-2004) according to new algorithm of computingchecksum in googlebar.
COPYRIGHT
Copyright 2004-2006, Yuri Karaban, All Rights Reserved.
You may use, modify, and distribute this package under the same terms as Perl itself.
Module Install Instructions
To install WWW::Google::PageRank, copy and paste the appropriate command in to your terminal.
cpanm WWW::Google::PageRank
perl -MCPAN -e shell install WWW::Google::PageRank
For more information on module installation, please visit the detailed CPAN module installation guide.