#!/usr/bin/perl -w use strict; use File::Copy qw(copy); use LWP::Simple qw(mirror is_error); my $url = 'http://...'; my $file = '/home/juerd/tmp/foo.html'; copy $file, "$file.old" or warn $!; my $status = mirror $url, $file; warn "HTTP $status" if is_error $status; system qw(diff -u), "$file.old", $file;
#!/usr/bin/perl -w use strict; +use File::Copy qw(copy); -use LWP::Simple qw(mirror is_success); +use LWP::Simple qw(mirror is_error); my $url = 'http://...'; my $file = '/home/juerd/tmp/foo.html'; -rename $file, "$file.old" or warn $!; +copy $file, "$file.old" or warn $!; my $status = mirror $url, $file; -warn "HTTP $status" unless is_success $status; +warn "HTTP $status" if is_error $status; system qw(diff -u), "$file.old", $file;
In reply to web page update notifier by Juerd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |