Question

I'm writing a little desktop application that plugs into Google Calendar (or other iCal-powered services) and displays event reminders. It automatically redownloads the iCal file every so often. If the file checksum has changed, I throw out the current appointment cache and reparse the calendar.

The thing is, this doesn't work with Google Calendar files. Upon further inspection, it came to my attention that the DTSTAMP: property on all events changed every time I redownloaded the iCal file associated with a certain calendar. So a standard checksum may not be the way to go here. There are two main solutions I'm considering.

  • Calculating the checksum based on the original file with the DTSTAMP: lines thrown out. (dirty)
  • Implementing a full calendar diff algorithm that detects which sections of the calendar are new, which have been thrown out, which have changed, etc. (expensive)

I don't know if the iCal format has any other quirks I haven't discovered yet, so I don't know if method 1 will solve my problem. Limited tests seem to indicate that it does. On the other hand, method 2 seems unnecessarily costly in terms of CPU power.

What would you suggest?

Was it helpful?

Solution

Not sure if google calendar follows 100% of rfc5545 but there should be a sequence number which "defines the revision sequence number of the calendar component within a sequence of revisions."

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top