I came across urlwatch whilst looking for something to tell me if a web page had been updated.
Its pure python, and easy for even a beginner like me to read and sus out once I’d worked out where the files were.
Your can install it with sudo pip install urlwatch – I needed to install the futures thing too – sudo pip install futures
It has the capability to send updates as email, but it did not support email to an authenticated SMTP server. After a bit of digging I saw that email is handled by /usr/local/lib/python2.7/dist-packages/urlwatch/mailer.py
from email.mime.text import MIMEText
def send(smtp_server, from_email, to_email, subject, body):
msg = MIMEText(body, ‘plain’, ‘utf_8’)
msg[‘Subject’] = subject
msg[‘From’] = from_email
msg[‘To’] = to_email
s = smtplib.SMTP()
s.sendmail(from_email, [to_email], msg.as_string())
I needed to edit the server port from 25 to a higher number correct for my service provider, and also add a line between the s.connect and the s.sendmail
edit the urls.txt file in your .urlwatch directory, then stick an entry in crontab for urlwatch -t to_email -s mailserver
and whenever it runs it will tell you if any of the web pages in your urls.txt have changed since it last run