sourcecode
gmpassos
<code>
#####################################
# PLAY WITH THE PERLMONKS SITE (0). #
#####################################
use LWP::Simple ;
$|=1;
my $numdays = 1 ;
my $url = "http://www.perlmonks.org/index.pl?node_id=3628&numdays=$numdays" ;
print "Getting Newest Nodes...\n" ;
print "$url\n" ;
$html = get($url);
$html =~ s/\r\n?/\n/gs ;
$html =~ s/<.*?>//gs ;
my (@users) = ( $html =~ /by\s+(\w+)\s*\n/gsi );
my %users ;
foreach my $users_i ( @users ) { $users{$users_i}++ ;}
my $total_usr ;
my $nodes = @users ;
print "-----------------------------\n" ;
foreach my $Key ( sort {$users{$b} <=> $users{$a}} keys %users ) {
my $Value = $users{$Key} ;
print "$Key = $Value\n" ;
$total_usr++ ;
}
print "-----------------------------\n" ;
print "Total users: $total_usr\n" ;
print "Nodes: $nodes\n" ;
</code>
# Send your feedback! <br>
# <br>
# "The creativity is the expression of the liberty".
Let's play with the PerlMonks site (code 0). This code get the page "Newest Nodes", see what users have posted, count the number of nodes, and show a list of user by activity.
PerlMonks Related Scripts
Graciliano M. P.