Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

scot (6695)

scot
  (email not shown publicly)
http://redcloudresearch.com/

Perl hacker
"apprentice" sysadmin for ASP running Sparc-Solaris-Java-Oracle stack

Journal of scot (6695)

Tuesday January 02, 2007
01:27 PM

Simple automated file retriever

[ #32046 ]

I whipped this together to grab web pages on a daily basis:


use strict;
use LWP::Simple;
use Time::localtime;
use File::Basename;

open (DATA, "urllist.txt") || die "File open failure!";
while (my $downloadurl = <DATA>){
        (my $name, my $path, my $suffix) = fileparse($downloadurl);
        my $finurl = $downloadurl;
                print $finurl."\n";
        my $lt = localtime();
        my $now_string = $lt->mon." ".$lt->mday;

        my $savefilename = $now_string.$name.$suffix;
                print $savefilename;
                print "\n";
        my $status = getstore($finurl,$savefilename);
                print $status."\n"
}

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.