For Programmers: Free Programming Magazines  


Home > Archive > PERL Programming > October 2004 > combination with wget and incresing number ?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author combination with wget and incresing number ?
Jesper Hansen

2004-10-07, 3:56 pm

i know it is possible to make a perl script that
has a variable like a and a is 1 with at start
then it downloads 1.pdf from some site. and restarts
just taking a+1=2 => 2.pdf => restart => a+1=3 3.pdf

i bet its real easy but i cant see how to make it
Klaus Byskov Pedersen

2004-10-07, 3:56 pm

Are you thinking about something like this:

#!/usr/bin/perl -w
my $i = 1;
while($i < 18){
`mkdir angel$i`;
$s = 1;
`wget
http://jupoi:koolo\@www.angellogn.n...rs/pics/gallery$i/$s.jpg -O
angel$i/$s.jpg`;
while(-s "angel$i/$s.jpg"){
$s++;
`wget
http://jupoi:koolo\@www.angellogn.n...rs/pics/gallery$i/$s.jpg -O
angel$i/$s.jpg`;
}
`rm angel$i/$s.jpg`;
$i++;
}



;-)

/Klaus

On Thu, 7 Oct 2004, Jesper Hansen wrote:

//i know it is possible to make a perl script that
//has a variable like a and a is 1 with at start
//then it downloads 1.pdf from some site. and restarts
//just taking a+1=2 => 2.pdf => restart => a+1=3 3.pdf
//
//i bet its real easy but i cant see how to make it
//
Klaus Byskov Pedersen

2004-10-07, 3:56 pm

Or this perhaps?

#!/usr/bin/perl -w
my $i = 0;

`mkdir pornstarguru`;

my %names = ( 'alexarae' => 8,
'alexa_kai' => 6,
'alexismalone' => 3,
'allysonchains' => 1,
'aprilflowers' => 8,
'aria' => 12,
'ashton' => 4,
'asia' => 4,
'aurora' => 10,
'ava' => 7,
'becky' => 2,
'brittneyskye' => 8,
'cameroncruise' => 6,
'daisy' => 9,
'danny' => 6,
'dynamite' => 3,
'gauge' => 12,
'gina' => 2,
'greeneyes' => 3,
'harley' => 6,
'heni' => 6,
'isabella' => 5,
'jade' => 13,
'jana' => 3,
'jodymoore' => 6,
'julie' => 5,
'kelle' => 7,
'kiana' => 4,
'mandy' => 3,
'mikatan' => 4,
'monica' => 4,
'nikita' => 4,
'nikki' => 4,
'obsession' => 3,
'silviasaint' => 6 );

foreach $ggal (keys %names){

`mkdir pornstarguru/$ggal`;
$i = 0;
while($i++ < $names{$ggal}){
`mkdir pornstarguru/$ggal/pics$i`;
$f = &getall($i, $ggal);
`rm $f`;
}

}

sub getall{
my $num = shift;
my $gal = shift;
my $ugal = uc($gal);

my $r = 0;
while(++$r){
$s = $r < 10 ? '0' . $r : $r;
$cmd = "wget
http://gallery.pornstarguru.com/gallery/$ugal/$gal$num/$gal$num" .
"_0$s.jpg -O $gal/pics$num/$gal$num" . "_0$s.jpg";
`$cmd`;
print "/pornstarguru/$gal/pics$num/$gal$num" . "_0$s.jpg";
$file = "pornstarguru/$gal/pics$num/$gal$num" .
"_0$s.jpg";
return $file unless -s $file ;
}
}


On Thu, 7 Oct 2004, Jesper Hansen wrote:

//i know it is possible to make a perl script that
//has a variable like a and a is 1 with at start
//then it downloads 1.pdf from some site. and restarts
//just taking a+1=2 => 2.pdf => restart => a+1=3 3.pdf
//
//i bet its real easy but i cant see how to make it
//
Tintin

2004-10-08, 8:58 am


"Jesper Hansen" <dsl125723@vip.cybercity.dk> wrote in message
news:ck3usq$1nsj$1@news.cybercity.dk...
>i know it is possible to make a perl script that
> has a variable like a and a is 1 with at start
> then it downloads 1.pdf from some site. and restarts
> just taking a+1=2 => 2.pdf => restart => a+1=3 3.pdf
>
> i bet its real easy but i cant see how to make it


#!/usr/bin/perl
use LWP::Simple;

foreach my $a (1..10) {
getstore "http://www.example.com/$a.pdf", "/path/to/$a.pdf" or die "Get
failed $!\n";
}


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com