#!/usr/bin/perl -w

# jerkcat.pl  --  a program to cat out jerkcity

if(!$ARGV[0] or $ARGV[0] =~ /[^0-9]+/) {
    print "usage : jerkcat.pl <jerkcity strip number>\n";
    exit(0);
}

# cat's out the text contents of a given jerkcity number

$current = $ARGV[0];

#wget the page
print `wget -q -O foobar.html http://www.jerkcity.com/jerkcity$current.html`;

#set up filehandles
$jerktext = `cat foobar.html`;

#get everything in the <tt> tags
$jerktext =~ s/[\w\W]*<tt>([\w\W]+)<\/tt>[\w\W]*/$1/gi;

#remove <br>'s
$jerktext =~ s/<br>//g;

# cat it
print $jerktext . "\n";

# remove the temp file
exec('rm foobar.html');
