[LUGOS-PROG] awk html

Gregor Ibic gregor.ibic at intelicom.si
Thu Jan 31 15:10:46 CET 2002


No, no, nekaj takega sem iskal.
Hvala

Lp,
Gregor

-----Original Message-----
From: Nikola Cavar [mailto:nikola.cavar at hermes.si]
Sent: Thursday, January 31, 2002 2:53 PM
To: lugos-prog at lugos.si
Subject: Re: [LUGOS-PROG] awk html


Lahko pa naredis nekaj takega... nino.

PS: Ni awk je pa precej lazje....


> #!/usr/bin/perl
> 
> use LWP::UserAgent;
> use HTTP::Request;
> use HTTP::Response;
> use HTML::SimpleLinkExtor;
> 
> $ua = new LWP::UserAgent;
> 
> while(1) {
> 	$request = new HTTP::Request('GET', 'http://www.celebdaily.com/');
> 	$response = $ua->request($request);
> 
> 	if ($response->is_success) {
> 	  print "succ\n";
> 		last;
> 
> 	} else {
> 	  print "fail\n";
> 		;;
> 	}
> }
> 
> $e = HTML::SimpleLinkExtor->new();
> $e->parse($response->content);
> @links = $e->href;
> 
> chdir("/mnt/depot/babes");
> 
> foreach $link (@links) {
> 	if($link =~ /[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/) {
> 		system("wget -c \"http://www.celebdaily.com/$link\"");
> 	}
> }





More information about the lugos-prog mailing list