WWW::Compete - Simple OO interface for retrieving site rank, traffic stats, and trust rating from www.compete.com
use WWW::Compete; use constant COMPETE_API_KEY => 'XXXXX'; my $c = WWW::Compete->new({api_key => COMPETE_API_KEY}); $c->fetch("cpan.org"); $c->get_measurement_yr(); $c->get_measurement_mon(); $c->get_trust(); $c->get_visitors(); $c->get_rank(); $c->get_summary_link();
This module is a simple wrapper around the Site Analytics API offered by www.compete.com. You can use this to basic traffic-related statistics for your favorite, or even your least favorite, domain.
Valid arguments:
api_key
string. Compete API key
api_ver
string Version of the Compete API you wish to use. Defaults to 3.
return_int
boolean If value evaluates to true, formatting will be removed from visitor counts an rank. For example, you'll get '4321567' instead of '4,321,567.' Defaults to false.
Get/set the Compete API key to be used.
Get/set the Compete API version you want to interact with. Default is 3.
Get/set the User-Agent header sent with your API requests. By default this is "libwwww-perl/#.##". Depending on what you're doing you may want to pass something else.
Send a request to the Compete API asking for stats on $domain.
Returns the year for the measurement.
Returns the month for the measurement.
Returns the current domain.
Returns the unique visitor estimate for measurement year and month.
Returns ranking for the domain, based on unique visitor estimates.
Returns trust rating for the domain.
Returns a link to Compete's traffic summary page for the domain.
This module is a wrapper around the Compete Site Analytics API. Additional detail on the API, and also on how to get a developer key, is available here.
http://developer.compete.com/
Chris Mills, <cmills@cpan.org>
Copyright (C) 2009 by Chris Mills
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install WWW::Compete, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Compete
CPAN shell
perl -MCPAN -e shell install WWW::Compete
For more information on module installation, please visit the detailed CPAN module installation guide.