[LUGOS-PROG] awk html
Nikola Cavar
nikola.cavar at hermes.si
Thu Jan 31 14:52:55 CET 2002
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