Andy Lester sent me a program to look at O'Reilly weblog stats, which webloggers can get on themselves (maybe others, too, I think). I wanted to add a little to that, and I got carried away.
I get this output now, which is just what I want. It has the number of times someone has looked at the entry, its rank in the O'Reilly system, and the title. I could also add the date of entry and other things, but I do not care about that so much.
O'Reilly Net report for 12/4/2003 Views Rank Title ------ ------ -------------------- 29196 783 Controlling iTunes with Perl 23211 1131 Cleaning iTunes 400 3067 The ability to innovate
#!/usr/bin/perl -w use strict;
END { my $user = "bar"; my $password = "foo"; my $verbose = 0; my $stats = MyStats->just_do_it( $user, $password, $verbose ); }
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # package MyStats;
# LOTS OF STUFFED SNIPPED
sub just_do_it { my $class = shift; my $self = $class->new( @_ ); $self->get_page->cleanse_page->extract_results-> sort_results->print_header->print_results; return $self; }
sub print_header { my $self = shift; my @times = localtime(); print "O'Reilly Net report for ", join( "/", $times[4]+1, $times[3], $times[5]+1900 ), "\n"; $self; }
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/brian-d-foy login
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/brian-d-foy co ora-weblog-stats