[Memphis.pm] web madness with LWP::UA

Alaric Ravenhall alaricravenhall at hotmail.com
Thu Jun 28 22:26:57 CDT 2001


Well.. here's a start. It can pull the index.html.
I'm thinking now, I'll include CGI to pass some variables from the browser, 
to redefine what I want to GET ;)
Nathan

#!/bin/perl
  use LWP::UserAgent;

  my $ua = LWP::UserAgent->new;
  my $req = HTTP::Request->new(GET => 'http://kracked.com:3015');

  $req->header(Accept => 'text/html');

  # Ask for page and capture response
  my $res = $ua->request($req);

  # did it work?
  if ($res->is_success) {
     print $res->content;  # for instance
  } else {
     print "Error: " . $res->status_line . "\n";
  }


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

----------------------------------------------------------------------------
To unsubscribe, please send email to majordomo at pm.org
with 'unsubscribe memphis-pm-list' in the body of the message.
----------------------------------------------------------------------------




More information about the Memphis-pm mailing list