#!/usr/bin/perl require LWP; require HTTP::Cookies; require Time::HiRes; #my $req = HTTP::Request->new(GET => "http://www.mastercard.nl/vakantiecheck/check.asp?pAction=FLASHCIJFERCHECK&pCijfers=$a"); my $ua = LWP::UserAgent->new(keep_alive => 1); $ua->agent("Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/85 (KHTML, like Gecko) Safari/85"); $ua->proxy('http', 'http://wwwproxy.xs4all.nl:8080/'); $cj = HTTP::Cookies->new(hide_cookie2 => 1); $ua->cookie_jar( $cj ); my $req = HTTP::Request->new(GET => "http://www.mastercard.nl/vakantiecheck/pg_code_invoer_html.asp"); $cr = $ua->simple_request($req); while (<>) { $a = sprintf("%04d", $_); # sleep 3 + rand 4; my $req = HTTP::Request->new(GET => "http://www.mastercard.nl/vakantiecheck/check.asp?pAction=FLASHCIJFERCHECK&pCijfers=$a"); my $resp = $ua->request($req); if (!($resp->content eq "g_bResult=false" )) { print "En de winnaar is.... $a!\n[", $resp->content, "]\n"; exit(0); } print "$a: ".$resp->content."\n"; # sleep rand 30; $ua->cookie_jar->clear(); my $req = HTTP::Request->new(GET => "http://www.mastercard.nl/vakantiecheck/pg_code_invoer_html.asp"); $cr = $ua->simple_request($req); } print "Huu, geen winnaar?\n"; exit(-1);