All pastes #468825 Raw Edit

Something

public text v1 · immutable
·published 2007-05-03 12:05 UTC
rendered paste body
#!/usr/bin/perl

use LWP::Simple;

for (my $i = 1; $i < 25;$i++) {
  $i = sprintf "%02d", $i;
  my $content = get("http://www.samair.ru/proxy/proxy-$i.htm");
  die "Couldn't get it!" unless defined $content;

  foreach my $ok (split(/\n/, $content)) {
    #parse ip
    if ( $ok =~ m/proxy[1-9]{4}/ ) {
      $ok =~ m/(\d+)<[^>]+>\.<[^>]+>(\d+)\D+(\d+)\.(\d+):/;
      push(@ips, "$1.$2.$3.$4");
    }
    if ( $ok =~ m/^(\d+)/ ) {
      push(@ports, $1);
    }
  }
  foreach $ip (@ips) {
    print $ip;
    print ":$ports[$a]\n" ;
    $a++;
  }
  $a=0;
}