I made a script too, then I found your script when I searched later!
Your script is more efficient, now I just use yours :P I call it
directly from procmail.

On Thu, Nov 15, 2007 at 11:42:53AM +0530, ram wrote:
> ----
> #!/usr/bin/perl
> # Script to emulate a browser for posting a abuse complaint to google
> use strict;
> # Modules with routines for making the browser.
> use LWP::UserAgent;
> use HTTP::Request::Common;
> use Data::Dumper;
> my %tag;
> 
> $tag{url}='http://www.google.com/support/pages/bin/request.py?ctx=submitted&confirm=abuse_spam';
> 
> my ($URL,$BODY);
> while(<>){
>     $BODY.=$_;
>     if(m;(https?://[\w\_\-\.]+\.googlepages.com);){ 
>       $URL=$1;
>     }
> }
> unless($URL) { 
>     die "Could not get googlepages URL\n";
> }
> 
> $tag{fields} = { 
>     'extra.Language' => 'en',
>     'extra.IssueType' => 'abuse_spam',
>     'subject' => '',
>     'extra.Name' => 'Ramprasad A Padmanabhan',
>     'email' => '[EMAIL PROTECTED]',
>     'extra.Name' => $URL,
>     'body' => $BODY,
>     'Action_Send' => 'Submit'
>     };
> #print Dumper([\%tag]); exit 0;
> my $lwp = new LWP::UserAgent;
> if($tag{browser}) { $lwp->agent($tag{browser}); }
> my $Page = $lwp->request(POST $tag{url},$tag{fields});
> if ($Page->is_success) { print $Page->content; }
> else { print $Page->message; }
> 
> --------------------------------

Reply via email to