lunedì 18 agosto 2008

[Perl] BidVertiserChecker

Descrizione
Controlla le entrate su BidVertiser.

Codice
use WWW::Mechanize;
my $mech = WWW::Mechanize->new( autocheck => 1 );
use Win32::Console::ANSI;
print "\e[1;37;44mBidVertiser\n\e[0m";
$mech->get('http://www.bidvertiser.com/');
$mech->submit_form(
form_name => 'LoginFormAdv',
fields => {
bdv_type => 'pbl',
Member_ID => 'username',
Password => 'password',
},
);

$a = $mech->content;
if($a =~ /<td width=\"160\" class=\"Top-Bar-Bttn-TD\" align=\"center\" onclick=\"document.location.href=\'(.*?)\';\" style=\"cursor:pointer;\"><span class=\"Top-Bar-Bttn\" >BidVertiser Summary<\/span><\/td>/){
$mech->get($1);
}
$a = $mech->content;
if($a=~/<b>Total<\/b><\/td>\s*?<td><b>(.*?)<\/b><\/td>\s*?<td><b>(.*?)<\/b><\/td>\s*?<td><b>(.*?)<\/b><\/td>\s*?<td><b>(.*?)<\/b>/){
print "Impressions: $1\nClicks: $2\nRevenue: $3\nCPC: $4\n\n";
}
system("PAUSE");

0 commenti: