Name: 2009-08-18 10:35
Output a thousand Sussmen in an individualistic way.
#!/usr/bin/perl
use strict;
use warnings;
die 'USAGE: progfind.pl [regex]' if scalar(@ARGV) < 1;
my $regex = join ' ', @ARGV;
`curl -sO http://dis.4chan.org/prog/subject.txt`;
open my $subj, 'subject.txt';
my $i = 0;
while (<$subj>) {
my ($ti,$au,$wut,$id,$le,$lp,$li) = split '<>';
next unless $ti =~ /$regex/i;
`curl -so temp.html http://dis.4chan.org/read/prog/$id`;
open my $fh, 'temp.html';
while (<$fh>) {
while (/$regex/ig) { $i++; }
}
close $fh;
}
close $subj;
print $i;