All pastes #806851 Raw Edit

Someone

public text v1 · immutable
·published 2007-12-05 23:47 UTC
rendered paste body
#!/usr/bin/perl
use LWP;

$ua = LWP::UserAgent->new;
$resp = $ua->get('http://www.thegreenpapers.com/P08/candidates.phtml');
$con = $resp->content;
#@words = ("Obama", "Giuliani", "Huckabee", "Hunter", "Keyes", "S. McCain", "Paul", "Romney", "Tancredo", "Thompson", "Zarwell");
@words = ("Brownback");
foreach $werd(@words){
if ($con =~ m~</a><a name="(.*)"></a><b>(.*) $werd</b> of (.*)</td></tr>\n(.*)~gmi)
{
  $state = $3;
  $position = $2;
    $nextline = $4;
  if ($position =~ /Senator/){$pos = "Senator of $state";}
  elsif($position =~ /Governor/){$pos = "Governor of $state";}
  elsif($position =~ /Ambassador/){$pos = "Ambassador";}
  elsif($position =~ /former Ambassador/){$pos = "Former Ambassador";}
  elsif($position =~ /Congressman/){$pos = "House of Representatives for $state";}
  else{ $pos = "Neither"; }
}
if ($nextline =~ m~Total receipts: \$(.*)</span>~gmi)
{
    $money = $1;
}
#open(RESULT,">>C:/prim08.txt");
print  "$position $werd\nPosition: $pos\nState: $state\nFEC: $money\n\n";

#close(RESULT);
 }