M

MoMI-ics-cleanup

Using a plain text file of URLs separated by newlines, download ical files from the Museum of the Moving Image site, fix their DTEND times, and create a new .ics file ready for import into a calendar.

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 misleading 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 new unified .ics file ready for import into a calendar.

Disclaimers:

  • 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 .ics file 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 DTEND issue on their end and now some, but not all, of their iCalendar files have proper durations. So I'm doing this.)
  • No Maintenance Intended

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.

Blog post announcement, with screenshot.