[Catalyst] CatalystSites.org
Stephen Sykes
stephen at stephensykes.us
Mon Apr 7 03:54:48 BST 2008
Ashley wrote:
> On Apr 6, 2008, at 4:57 PM, Stephen Sykes wrote:
>> I think you need to pay for the api, but I could be wrong as I'm not
>> that familiar with their system. Isn't Quantcast basically the same
>> setup? You need to signup and add their javascript code to your pages.
>
> You can do that, and I have with one site, but they were *very* close
> to the exact traffic numbers before I did (and on other sites I work on).
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
Well, now I am interested. I made a quick utility script to see if I
could fetch a site's rank from their site and it seems to be easier than
I expected. ;-)
#!/usr/bin/perl -w
use strict;
use LWP::Simple;
my $site = "sedition.com";
my $quant_url = "http://www.quantcast.com/search/" .$site;
my $get_page = get($quant_url) or die 'Unable to fetch: ' .$quant_url;
my @quant_file = split(/\n/, $get_page);
my $rank_count = 0;
foreach my $rank (@quant_file) {
if ($rank =~ "Rank: <strong>") {
$rank_count++;
if ($rank_count == 1) {
$rank =~ s/\D//g;
print "Quantcast rank for " .$site. ": " .$rank. "\n";
}
}
}
[stephen]
More information about the Catalyst
mailing list