Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

•Re: •Re: •Re: Swimsuit issue

by merlyn (Sage)
on Feb 16, 2004 at 18:53 UTC ( [id://329407]=note: print w/replies, xml ) Need Help??


in reply to •Re: •Re: Swimsuit issue
in thread Swimsuit issue

And for 2004, only a few minor tweaks needed:
use strict; $|++; use LWP::Simple; my @models = qw( ana angela bridget carolyn elsa fernanda frankie jessica jessicaw marisa may melissa molly noemie petra veronica yamila ); # http://s.a.cnn.net/si/features/2004_swimsuit/images/gallery/popup/ma +y_03.jpg for my $model (@models) { for my $id (0..15) { my $url = sprintf "http://s.a.cnn.net/si/features/2004_swimsuit/" +. "images/gallery/popup/%s_%02d.jpg", $model, $id; my $file = "$model-$id.jpg"; print "$url => $file: "; print +mirror($url, $file), "\n"; } }

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.


update: check out the 2005 edition as well.

Replies are listed 'Best First'.
Re[3]: Swimsuit issue
by Intrepid (Deacon) on Feb 16, 2004 at 21:21 UTC

    When this script got mentioned in the chatterbox today, a bunch of us Monks were on it like ants on jello. In order to even out the server requests I thought a randomizing rendition of the script might help. Subjectively it does seem my fetches (over dialup connection) ARE going a little faster with it. Thus, this:


    #--------------------------------------------------------------------- +- # Based on perl code d/l from Perlmonks node: 329407 # View Original At: # http://www.perlmonks.org/?node=329407&displaytype=displaycode #--------------------------------------------------------------------- +- use strict; $|++; use LWP::Simple; my($file,$url,%potenpics); my @models = qw( ana angela bridget carolyn elsa fernanda frankie jessica jessicaw marisa may melissa molly noemie petra veronica yamila ); for my $model (@models) { for my $id (0 .. 15) { $potenpics{"$model-$id.jpg"} = sprintf "http://s.a.cnn.net/si/features/2004_swimsuit/" . "images/gallery/popup/%s_%02d.jpg", $model, $id; } } while (($file,$url) = each %potenpics) { print "$url => $file: "; unless (-e $file and -s _) { print +mirror($url, $file), "\n" } else { print "skipped, already exists\n"} }

        Soren A / somian / perlspinr / Intrepid
    P.S. Don't forget: I am expecting all the people the people who say I am posting to Perlmonks for the XP to automatically downvote this posting w/o explanation, thanks.

    -- 
    Try my n.y.p.m.blue Perl Monks CSS Theme
    (edit "On-Site CSS Markup" on the User Settings node)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://329407]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-25 09:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found