For the curious, the code to retrieve the information from pmstats is here:
#!/usr/bin/perl use strict; use warnings; use LWP::UserAgent; my $start=5000; my $ua = LWP::UserAgent->new(); my $out; my %monkdays; if ($ARGV[0] eq "readfile"){readfile()} open ($out,">>","monkdays.txt") or die "Can't open file because $!"; while ($start < 10000) { my $req = HTTP::Request->new(GET=>"http://tinymicros.com/pm/index. +php?goto=monkstats&sortopt=7&sortlist=10%2C1%2C3&start=$start&"); my $result = $ua->request($req); my $content; if ($result->is_success){$content= $result->content} else {last} for (split/<\/TR>/,$content) { my (@fields)= $_=~ /<NOBR>(.*?)<\/NOBR>/g; my $nick; my $first; if ($fields[2] =~ /HREF/ && ($fields[3]=~/^[2005|2006]/)) { ($nick) = $fields[2]=~/blank">(.*?)<\/A>/; ($first) = $fields[3]=~/(\d+\-\d+\s+)/; } else { next } # push @{$monkdays{$first}},$nick; print $out "$nick - $first\n"; } print $out "$start\n"; $start +=50; sleep 15; } sub readfile { my $in; open ($in,"<","monkdays.txt") or die "Shan't! $!"; while (<$in>) { if ($_ =~/^\d+$/){next} my ($nick,$first) = split / - /,$_; push @{$monkdays{$first}},$nick; } for (sort keys %monkdays) { print $_."\n"; for (@{$monkdays{$_}}) { print $_."\n"; } print "\n"; } exit; }
and the code to turn it into a html table is here:
se strict; use warnings; my %months; my @m = qw (Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec); for (0..11) { $months{$_+1} = $m[$_]; } my $file; open ($file,"<","md.txt") or die "shan't! $!\n"; my %mdays; my ($month,$day); while (<$file>) { chomp $_; if ($_ =~ /(\d{2})-(\d{2})/) { $month = $1; $day = $2; $month +=0; $day +=0; # make sure these scalars are properly numeric } elsif ($_ eq "") { next } else { push @{$mdays{$month}->{$day}},$_; } } #use Data::Dump::Streamer; #my $dump = Data::Dump::Streamer->new(); #$dump->Dump(%mdays)->Out(); print "<table border=1>"; for (my $month=1;$month<=12;$month++) { print "<tr><td>$months{$month}</td></tr>\n<tr>"; for my $day (sort {$a<=>$b} keys %{$mdays{$month}}) { print "<td valign=top>$day<br>"; for my $monk (@{$mdays{$month}->{$day}}) { print "$monk<br>"; } print "</td>"; } print "</tr>"; print "</tr>\n"; }
I constrained it to the 10,000 most recently logged in users (and put in a 15 second sleep between pages) so as not to abuse pmstats, which takes it back to the end of 2004, so it should include all the regulars, although some notable characters like paco will be absent.
There's also a bug, in that it didn't stop with 2006 & 2005, but by the time I noticed, it was too late. (no doubt there are plenty of other suboptimal things that could be pointed out as well).
There are also a few discrepancies (e.g. Old_Gray_Bear) between the 'first here' listed on monks homenodes, and the 'first here' listed on pmstats. I don't know why that is.
All that remains is to thank all those who make (and have made) this forum what it is, and to wish a very happy monkday to the following:
--------------------------------------------------------------
"If there is such a phenomenon as absolute evil, it consists in treating another human being as a thing."
John Brunner, "The Shockwave Rider".
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Happy monkday!
by turo (Friar) on Jan 15, 2006 at 00:39 UTC | |
by holli (Abbot) on Jan 15, 2006 at 01:05 UTC | |
by turo (Friar) on Jan 15, 2006 at 01:29 UTC |