Untitled

By Toxic Prairie Dog, 11 Years ago, written in Perl, viewed 764 times.
URL http://pb.stoleyour.com/view/ee6577b9 Embed
Download Paste or View RawExpand paste to full width of browser
  1. #!/usr/bin/perl -w
  2.  
  3. use strict;
  4.  
  5. # sobad
  6. my $content = `curl -s http://www.failheap-challenge.com/forum.php`;
  7. my $wanted = lc($ARGV[0]) || 'members';
  8.  
  9. my %values = ();
  10. if($content =~ /<div[^>]+id="wgo_stats".*?>(.*?)<\/div>/msi){
  11.   my $statblock = $1;
  12.   while($statblock =~ s/<dt>(.*?)<\/dt>\s*<dd>(.*?)<\/dd>//msi){
  13.      my $name = $1;
  14.      my $val = $2;
  15.      $val =~ s/\D//g;
  16.      $values{lc($name)} = $val;
  17.   }
  18. }
  19. print "Members: " . $values{$wanted} . " | members=" . $values{$wanted} || print 0;
  20.  

Reply to "Untitled"

Here you can reply to the paste above