Skip to content

Instantly share code, notes, and snippets.

@keedi
Created July 7, 2010 12:38
Show Gist options
  • Save keedi/466631 to your computer and use it in GitHub Desktop.
Save keedi/466631 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
use WWW::Mechanize;
my $m = WWW::Mechanize->new( agent => 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624' );
$m->get("file://home/alejandro/enter.php.html");
my $contents = $m->content();
my $regexp = qr{
(
<td \s* class="tm">
\s*
<a
\s+
href="http://valeptr.com/scripts/runner.php\?IM=.*?"
\s+
target="_inbox"
\s*
>
)
(.*?)
(
</a>
\s*
</td>
)
}xms;
my $num = 0;
$contents =~ s/$regexp/sprintf('%s xxxxxxxxxx-%d %s', $1, ++$num, $3)/gxmse;
print $contents;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment