Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

BooK (2612)

BooK
  {book} {at} {cpan.org}
http://paris.mongueurs.net/
Yahoo! ID: philippe_bruhat (Add User, Send Message)

Obfuscation [plover.com]. Pink [axis-of-aevil.net]. HTTP::Proxy [cpan.org]. YEF [yapceurope.org]. Fishnet [perl.org]. Kapow [cpan.org]. Cog's [perl.org] bitch [cpan.org]. Invitation [perl.org]. White [perl.org] Camel [perl.org]. Nuff' said.

Journal of BooK (2612)

Monday March 15, 2004
10:36 AM

A new filter for HTTP::Proxy!

[ #17913 ]

The next version of HTTP::Proxy will include a shiny new filter named HTTP::Proxy::BodyFilter::save. It can be used to save the files you want while you browse them. Here's a short example:

use HTTP::Proxy;
use HTTP::Proxy::BodyFilter::save;

my $proxy = HTTP::Proxy->new;
$proxy->logmask( shift );

# save RFC files as we browse them
$proxy->push_filter(
    path => qr!/rfc\d+.txt!,
    mime => 'text/plain',
    response => HTTP::Proxy::BodyFilter::save->new(
        template => '%f',  # %f is the filename
        prefix   => 'rfc', # prefix is a directory
        multiple => 0,
        keep_old => 1,
    )
);

$proxy->start;

Now, every time I browse a page that matches m!/rfc\d+\.txt!, the RFC file is automatically saved in the rfc/ directory. Cool.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.