Re: Re: Re: Untitled

By Ample Water Vole, 11 Years ago, written in Perl, viewed 692 times. This paste is a reply to Re: Re: Untitled by Lousy Bongo
URL http://pb.stoleyour.com/view/2654dfb6 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.  
  13.   while($statblock =~ s/<dt>(.*?)<\/dt>\s*<dd>(.*?)<\/dd>//msi) {
  14.      my $name = $1;
  15.      my $val = $2;
  16.      $val =~ s/\D//g;
  17.      $values{lc($name)} = $val;
  18.   }
  19.  
  20.   print "Members: " . $values{$wanted} . " | members=" . $values{$wanted};
  21.   exit;
  22. }
  23.  

Reply to "Re: Re: Re: Untitled"

Here you can reply to the paste above