[kw-pm] Recording HTTP

abez abez at abez.ca
Tue May 23 20:05:54 PDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Check out this module:
http://search.cpan.org/~leira/HTTP-Recorder-0.05/lib/HTTP/Recorder.pm
Unfortunately it craps out on some websites. It is supposed to write a
WWW::Mechanize script for you :) It sorta works.

Here's a quick script where you can monitor all your browser traffic,
I want to figure out what requests you are making:

#!/usr/bin/perl
use HTTP::Proxy;
use Data::Dumper;
my $proxy = HTTP::Proxy->new(port=>3128);
my $agent = SpecialAgent->new();
$proxy->agent( $agent );
$proxy->start();
package SpecialAgent; 
use base qw(LWP::UserAgent);
        
sub new {
        my$ self = shift()->SUPER::new(@_);
        return $self
}

sub prepare_request {
        my $self = shift;
        my $request = shift;
	#put a dumper here for more fun
        warn "PREP_REQUEST ".$request->as_string;
        return $self->SUPER::prepare_request($request);
}

1;


- -- 
abez ------------------------------------------
http://www.abez.ca/ Abram Hindle (abez at abez.ca)
- ------------------------------------------ abez
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFEc82enOrfa1yW8IURAp+3AKCNreR39OP3t9FW5QsfunOhs4xn7gCffs/E
ctyVRBNF708dc9BOGGHp4kg=
=huvq
-----END PGP SIGNATURE-----



More information about the kw-pm mailing list