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)

Saturday February 05, 2005
06:28 AM

HTTP::Proxy is actually useful for me!

[ #23025 ]

I'm looking at http://www.bookcloseouts.com/ to buy cheap computer books. Problem is, they just give the ISBN, and the usual information. That's not enough for me when the title rings a bell, and I want to find out if that book could actually interest me or not.

So, in about 5 minutes, I whipped up an Amazon.com integration of this site, thanks to HTTP::Proxy:

$proxy->push_filter(
    host     => 'www.bookcloseouts.com',
    response => HTTP::Proxy::BodyFilter::simple->new(
        sub {
             my ( $self, $dataref, $message, $protocol, $buffer ) = @_;
             $$dataref =~ s!ISBN: (\d+X?)!<a href="http://www.amazon.com/exec/obidos/ASIN/$1/">ISBN: $1</a>!g;
        }
    ),
);

And voilà!, now I can click the ISBN and see what Amazon reviewers have to say about it. Lazyness is rewarded, again.

My personal proxy on 127.0.0.1:8080 is just a collection of small filters that "correct and enhance" those few web sites I visit more or less regularly. I'm afraid that's the only way HTTP::Proxy is really useful: it will not change the web experience for your whole corporate network (not until I can link it up with mod_proxy), but it'll make your web experience more satisfying. Usually with very little work.

Now, if I only had the time to release that next version...

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.