WWW::Alexa::TrafficRank - Query Alexa.com Traffic Rank of website.


WWW-Alexa-TrafficRank documentation  | view source Contained in the WWW-Alexa-TrafficRank distribution.

Index


NAME

Top

WWW::Alexa::TrafficRank - Query Alexa.com Traffic Rank of website.

SYNOPSIS

Top

use WWW::Alexa::TrafficRank;

my $tr = WWW::Alexa::TrafficRank->new();

my $rank = $tr->get('guruperl.net'); my $country_rank = $tr->get_country_rank(Domain => 'guruperl.net', Country => 'United States');

print $rank, "\n", $country_rank;

DESCRIPTION

Top

The WWW::Alexa::TrafficRank is a class implementing a interface for querying Alexa.com Traffic Rank.

To use it, you should create WWW::Alexa::TrafficRank object and use its method get(), to query traffic rank of Domain.

It uses LWP::UserAgent for making request to Alexa.com

CONSTRUCTOR METHOD

Top

$tr = WWW::Alexa::TrafficRank->new(%options);

This method constructs a new WWW::Alexa::TrafficRank 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                   "Opera 10.0"
  proxy                   undef
  timeout                 undef

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

QUERY METHOD

Top

$rank = $tr->get('guruperl.net');

Queries Alexa for a specified traffic rank URL and returns traffic rank text value. If query fails for some reason (Alexa unreachable, undefined url passed) it return error string.

$country_rank = $tr->get_country_rank(Domain => 'guruperl.net', Country => 'United States');

Extract the rank in the country. If we get a match on the country name in the item then extract the ranking value and return. The country name must match the name of the country as displayed on the Alexa page.

BUGS

Top

If you find any, please report ;)

AUTHOR

Top

Guruperl.net<root@guruperl.net>.

  http://getabest.com/ - Software Downloads

  http://guruperl.net/ - Professional Scripts

COPYRIGHT

Top


WWW-Alexa-TrafficRank documentation  | view source Contained in the WWW-Alexa-TrafficRank distribution.