Category: | PerlMonks Related Scripts |
Author/Contact Info | Graciliano M. P. |
Description: | 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. |
#####################################
# 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=$num
+days" ;
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" ;
# Send your feedback! # # "The creativity is the expression of the liberty". |
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Playing with PerlMonks site (0) - See what user was more active
by jmcnamara (Monsignor) on Jul 25, 2002 at 08:31 UTC | |
by gmpassos (Priest) on Jul 25, 2002 at 19:14 UTC | |
Re: Playing with PerlMonks site (0) - See what user was more active
by Chady (Priest) on Jul 25, 2002 at 10:15 UTC | |
by Aristotle (Chancellor) on Jul 25, 2002 at 20:28 UTC |
Back to
Code Catacombs