I was using this PHP script until today, but now I run Python so I wrote my own script. If someone's interested: http://www.myepisodes.com/forum/viewtopic.php?t=2158
I was using a PHP script that someone posted here 5 years ago, but my server no longer runs PHP, so I have written this Django implementation (which can be easily converted to vanilla Python).