Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Swimsuits2012

by merlyn (Sage)
on Feb 15, 2012 at 16:21 UTC ( #953991=note: print w/replies, xml ) Need Help??


in reply to Swimsuits2011
in thread Swimsuits2004

And for 2012:
#!/web/perl use strict; $|++; use LWP::Simple; -d "RESULTS" or mkdir "RESULTS", 0755 or die "cannot mkdir RESULTS: $! +"; my $all_model_index = get "http://sportsillustrated.cnn.com/2012_swims +uit/models/"; while ($all_model_index =~ m{"(/2012[^"]+/)"}g) { doit("$1"); } doit("/2012_swimsuit/painting/$_/") for qw(alex-morgan natalie-coughlin natalie-gulbis); exit 0; my %done; sub doit { my $base = shift; return if $done{$base}++; print "$base =>\n"; # (print "[TEMP SKIPPED]", "\n"), return unless $base =~ /paint/; my $model_index = get "http://sportsillustrated.cnn.com/$base/index2 +.html"; unless ($model_index) { $model_index = get "http://sportsillustrated.cnn.com/$base/"; } while ($model_index =~ m{(\w+)\.html.*?\"(http://i.cdn.turner.com/si +/pr/subs/swimsuit/images/.*?[\w.\-]+)_t.jpg\"}g) { my $url = "$2.jpg"; my $file = "RESULTS/$1.jpg"; if (-e $file) { print "$url => $file: "; print "skip\n"; } else { print "$url => $file: "; print mirror($url, $file), "\n"; } } }

-- Randal L. Schwartz, Perl hacker

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Replies are listed 'Best First'.
Re: Swimsuits2012
by Tux (Abbot) on Feb 19, 2012 at 08:15 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://953991]
help
Chatterbox?
[james28909]: ok i have a new question ;)
[james28909]: i am not sure how to ask google this either
[james28909]: i am getting the current time on my machine with scalar localtime;
[james28909]: i am scraping a website and retrieving a date stamp of an article.
[james28909]: well time/data stamp of the article
[stevieb]: james28909: what's the problem/question?
[james28909]: it is not an absolute date like "27" or "31". sometimes it is like wednesday or friday

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2017-04-29 02:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (531 votes). Check out past polls.