WWW::Alexa::TrafficRank - Query Alexa.com Traffic Rank of website.
my $tr = WWW::Alexa::TrafficRank->new();
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.
LWP::UserAgent for making request to Alexa.com
- $tr = WWW::Alexa::TrafficRank->new(%options);
This method constructs a new
WWW::Alexa::TrafficRankobject 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
agentspecifies the header 'User-Agent' when querying Alexa. If the
proxyoption is passed in, requests will be made through specified poxy.
proxyis the host which serve requests to Alexa.
- $rank = $tr->get('filedir.com');
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.
If you find any, please report ;)
Copyright 2016, FileDir, All Rights Reserved.
You may use, modify, and distribute this package under the same terms as Perl itself.