I like seeing movies at the Museum of the Moving
Image. But it's a pain to individually
access each event's
.ics (iCalendar) file and import it into my
electronic calendar -- and the museum's
.ics files often include a
DTEND that implies the event has a duration of 0 seconds.
This script takes a plain text file of URLs separated by newlines (see
movie-urls-sample-file.txt for an example), downloads iCalendar
files from the MoMI site, fixes their event end times, and creates a
.ics file ready for import into a calendar.
- It can be a bit slow as the number of URLs adds up -- it took maybe 5 minutes to process about 31 events. I oughta profile it and speed it up. But I usually only need to do this about six times a year.
- This script is not careful, and will overwrite a previously created
.icsfile at the same address (in case you're running it twice in one day). It has no tests and approximately no error-checking.
- Absolutely not an official project of the Museum of the Moving Image.
(I asked them to fix the
DTENDissue on their end and now some, but not all, of their iCalendar files have proper durations. So I'm doing this.)
Much thanks to the programming ecology that helped me build this, especially the people who made http://www.regexr.com/ , Beautiful Soup, requests, and ics.py, and the many who have written excellent documentation on Python's standard library.