Created
September 6, 2019 18:48
-
-
Save waltman/51bba29f97499617af0f14f81107bdfb to your computer and use it in GitHub Desktop.
Script to check list of websites and report if any have changed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/perl -w | |
# $Id: watch-http,v 1.3 2007/03/26 11:58:59 waltman Exp $ | |
use strict; | |
use LWP::Simple; | |
my $dir = "$ENV{HOME}/.watch-http"; | |
chdir $dir | |
or die "Can't chdir to $dir: $!\n"; | |
open CONFIG, "config" | |
or die "Can't open $dir/config: $!\n"; | |
while (<CONFIG>) { | |
chomp; | |
next if /^#/; # ignore comments | |
my ($file, $url) = split /\s+/; | |
my $rc = mirror($url, $file); | |
if ($rc == RC_OK) { | |
print "$file ($url) has changed\n"; | |
system "svn diff $file"; | |
} elsif ($rc != RC_NOT_MODIFIED) { | |
printf "unexpected response code of %d (%s) checking %s\n", $rc, status_message($rc), $url; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment