Lynx???

Aaron Kilbey aaronkilbey at hotmail.com
Wed Jul 10 12:00:14 CDT 2002


So I used the following from yesterday:

---------------------------------------
newsdump.pl
---------------------------------------
$url="http://www.moreover.com/cgi-local/page?feed=239\&o=xml";
$file="news.xml";

use LWP::Simple;
&getstore( $url, $file );
---------------------------------------

...and when I run "bash$ perl newsdump.pl" it writes news.xml fine, but
when I try to do http://myserver/cgi-bin/newsdump.pl in a web browser,
news.xml
is not updated ??? - a.




-----Original Message-----
From: Ovid [mailto:poec at yahoo.com] 
Sent: Tuesday, July 09, 2002 2:38 PM
To: Aaron Kilbey; pdx-pm-list at pm.org
Subject: Re: FW: Lynx???

--- Aaron Kilbey <aaronkilbey at hotmail.com> wrote:
> Aloha everybody - 
> 
> I'm attempting to issue an http request through lynx to save an XML
file
> to a local server. 
> Here's the code:
> 
>
------------------------------------------------------------------------
> newsdump.pl
>
------------------------------------------------------------------------
> #!/usr/bin/perl
> 
> system("lynx -dump
http://www.moreover.com/cgi-local/page?feed=239&o=xml
> > news.xml"); 

A more portable solution:

  use LWP::Simple;
  getstore( $url, $file );

Or better:

  mirror( $url, $file );

You can verify this from the command line:

  perl -MLWP::Simple -e
'getprint("http://www.moreover.com/cgi-local/page?feed=239&o=xml")'

You'll also want to check the is_success() function in that module.

Cheers,
Curtis "Ovid" Poe

=====
"Ovid" on http://www.perlmonks.org/
Someone asked me how to count to 10 in Perl:
push at A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//;
shift at a;shift at a if $a[$[]eq$[;$_=join q||, at a};print $_,$/for reverse @A

__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com
TIMTOWTDI
TIMTOWTDI



More information about the Pdx-pm-list mailing list