spicone has asked for the wisdom of the Perl Monks concerning the following question:
Any help you can offer will be much appreciated. Also, if you could sort of explain what's going on, that would help to. Thanks.use strict; use HTTP::Cookies; use LWP::UserAgent; use HTTP::Request::Common; my $ua = LWP::UserAgent->new; $ua->cookie_jar(HTTP::Cookies->new(file => "cookie2.txt",autosave => 1 +,)); my $url_base = "http://news.phxlab.honeywell.com/phpbb/posting.php?mod +e=newtopic&f=12"; my $response = $ua->get($url_base); #print $response->content; my $request = HTTP::Request->new(POST=>'http://news.phxlab.honeywell.c +om/phpbb/login.php?sid=725b728e071beec160e85c81d048a151'); $request->authorization_basic('username', 'password'); my $response = $ua->request($request); my $content = $response->content; $content =~ s/\n//g;#extracting session id { print $response->content; # or whatever #print $content; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: LWP::UserAgent Help
by pc88mxer (Vicar) on Jun 13, 2008 at 19:19 UTC | |
by spicone (Initiate) on Jun 13, 2008 at 19:36 UTC | |
by pc88mxer (Vicar) on Jun 13, 2008 at 19:38 UTC | |
by jettero (Monsignor) on Jun 13, 2008 at 20:43 UTC | |
|
Re: LWP::UserAgent Help
by runrig (Abbot) on Jun 13, 2008 at 23:19 UTC | |
|
Re: LWP::UserAgent Help
by monarch (Priest) on Jun 13, 2008 at 22:26 UTC | |
by pc88mxer (Vicar) on Jun 13, 2008 at 22:57 UTC |