GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
WWW::Google::PageRank(3) User Contributed Perl Documentation WWW::Google::PageRank(3)

WWW::Google::PageRank - Query google pagerank of page

 use WWW::Google::PageRank;
 my $pr = WWW::Google::PageRank->new;
 print scalar($pr->get('http://www.yahoo.com/')), "\n";

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.

$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
   timeout                 undef
   env_proxy               undef
   host                    "toolbarqueries.google.com"
    

"agent" specifies the header 'User-Agent' when querying Google. If the "proxy" option is passed in, requests will be made through specified poxy. "proxy" is the host which serve requests from Googlebar.

If the "env_proxy" option is passed in with a TRUE value, then proxy settings are read from environment variables (see "LWP::UserAgent::env_proxy")

$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 by "LWP::UserAgent::get"). This can be usefull for debugging purposes and for querying failure details.

If you find any, please report ;)

Yuri Karaban <ykar@cpan.org>.

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 2004-2006, Yuri Karaban, All Rights Reserved.

You may use, modify, and distribute this package under the same terms as Perl itself.

2011-10-29 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.