I really enjoyed the series Firefly that aired a few years back. I've enjoyed it a few more times since. I'm really looking forward to the upcoming movie. So much so, in fact, that I even wanted to try to get into one of the pre-screenings. There's a website that announces dates and locations for pre-screenings. Being pretty lazy and also forgetful, I can't be bothered to actually check the website frequently enough to notice when new tickets are available before they are all sold out. Fortunately, being a programmer, I can simply bend a minion to my will. I whipped up this quickie to do the checking for me:
import rfc822, md5, sys
from twisted.internet import task, reactor
from twisted.mail import smtp
from twisted.python import log
from twisted.web import client
url = "http://www.cantstopthesignal.com/"
MSG = """\
Subject: The upcoming film, Serenity, is awesome
From: "A Respectable Internet Citizen" <firstname.lastname@example.org>
Serenity hash changed! Go look!
lastDig = None
dig = md5.md5(page).hexdigest()
if dig != lastDig:
if lastDig is not None:
sys.argv, # SMTP host
sys.argv, # sender email address
sys.argv[3:], # recipient email addresses
MSG % mailinfo())
lastDig = dig
task.LoopingCall(main).start(60 * 30)
The took about 10 minutes to write and even worked on the 2nd try (the first try I forget recipient addresses had to be a list and gave it a string instead). Then it ran for 21 days before sending me an email a few days ago! Alas, I don't live in Great Britain, or even Europe. It has also, of course, sent out an email once each time one of the listed theaters sells out. And now they're all sold out. :( Given the short period of time remaining before the probable release date, it seems unlikely there will be any more pre-screenings.