Re: Getting data from external URL

2000-08-29 Thread Gisle Aas
Steve Reppucci [EMAIL PROTECTED] writes: Just a word of warning: LWP::Simple doesn't follow redirects (at least, the last I checked, not sure if it's been changed in the 3 or 4 months since I've last used it...), If it does not follow redirects then that is a bug. Do you have a test case?

Re: Getting data from external URL

2000-08-29 Thread Steve Reppucci
Hmmm Looking at _trivial_http_get: if ($code =~ /^30[1237]/ $buf =~ /\012Location:\s*(\S+)/) { # redirect So it certainly seems like it's *trying to handle it. As I recall (it was a late night when I had an application that wasn't working), I had single stepped down into

Re: Getting data from external URL

2000-08-28 Thread Steve Reppucci
Just a word of warning: LWP::Simple doesn't follow redirects (at least, the last I checked, not sure if it's been changed in the 3 or 4 months since I've last used it...), so you need to be certain that you're using it in a context where you're fetching something that won't return a redirect.

Re: Getting data from external URL

2000-08-28 Thread Stas Bekman
On Mon, 28 Aug 2000, Steve Reppucci wrote: Just a word of warning: LWP::Simple doesn't follow redirects (at least, the last I checked, not sure if it's been changed in the 3 or 4 months since I've last used it...), so you need to be certain that you're using it in a context where you're

Re: Getting data from external URL

2000-08-28 Thread Jeff Beard
I just wrote a function yesterday that uses IO::Socket to interact with an outside CGI program. It appears to work the way I want but this is my first foray into writing TCP client code. It's basically this: sub tcp_client { my ( $rhost, $rport, $query_string ) = @_; my $socket =

Re: Getting data from external URL

2000-08-28 Thread Matt Sergeant
On Mon, 28 Aug 2000, Jeff Beard wrote: I just wrote a function yesterday that uses IO::Socket to interact with an outside CGI program. It appears to work the way I want but this is my first foray into writing TCP client code. It's basically this: sub tcp_client { my ( $rhost,

Re: Getting data from external URL

2000-08-26 Thread Rodney Broom
SB This one is much more efficient and requires even less coding: SB use LWP::Simple; SB $content = get("http://www.sn.no/") Even better, thanks Stas.

Re: Getting data from external URL

2000-08-26 Thread Vijay
"mod_perl Maillinglist" [EMAIL PROTECTED] Sent: Saturday, August 26, 2000 10:24 AM Subject: Re: Getting data from external URL SB This one is much more efficient and requires even less coding: SB use LWP::Simple; SB $content = get("http://www.sn.no/") Even better, thanks Stas.

RE: Getting data from external URL

2000-08-26 Thread Andrew Nicholson
Hello Vijay, You can make simple HTTP GET or POST requests using the LWP and HTTP modules. I recommend that you read the ActivePerl help files. I have attached the one you really need but it probably won't make sense unless you read up on LWP. # A small sample follows: use LWP::UserAgent; #

Re: Getting data from external URL

2000-08-26 Thread Rodney Broom
OK, lots of banter... Hey V, if you are on a *NIX system, then this is a fast way: open U, "lynx -source www.some.url.dom |"; $data = join '', U; There, you're finished. Admittedly, this isn't terribly efficiant, but it works just fine and has short devel time. Rodney Broom

Re: Getting data from external URL

2000-08-26 Thread Stas Bekman
On Sat, 26 Aug 2000, Rodney Broom wrote: OK, lots of banter... Hey V, if you are on a *NIX system, then this is a fast way: open U, "lynx -source www.some.url.dom |"; $data = join '', U; There, you're finished. Admittedly, this isn't terribly efficiant, but it works just fine and has

Re: Getting data from external URL

2000-08-26 Thread Gerald Richter
Hello, I want to get data from an external url in my perl program (either thru Embperl Execute or directly from perl). What I need is like this. There is a URL which gives some information in text format. I want to get that into a variable or file using perl and using my own html

Re: Getting data from external URL

2000-08-25 Thread Yann Ramin
If you're in a modperl enviroment, and don't use CGI.pm, try using Apache::Request (I'm not a fan of using Apache.pm for too much). Has anyone ever considered making a wrapper for all the modules which get back data from the request (roll Apache::Request, Apache::Cookie, etc, into one)? Seems

Re: Getting data from external URL

2000-08-25 Thread Rob Tanner
Apache::Request simply maps the Apache object into an Apache::Request object (I know that sounds like double-speak, but it's late), and adds some extra methods. I don't think that's what Vijay's original question is all about. What's needed is an HTTP::Request object. Look at LWP::UserAgent