5
votes

I'm syncing the Google Calendar with my application (I store events in a database). When an event is updated I can easily find the last updates by sorting the event feed on the 'updated' order. However, if an event is removed / deleted, how can I track this update from the feed?

2
Do you mean if someone deletes the event from the Google side or from your database?Brian Neal

2 Answers

7
votes

Try to add showdeleted=true to your query feed and then check for EventStatus.CANCELED on retrieved entries.

Check this thread for further information.

-1
votes

I did exactly the thing you want to do (see this post: http://code.pui.ch/2009/12/29/fetch-publicly-available-google-calendar-data-with-python/):

I have a database with events imported from Google and events that can be edited from an admin interface (Django). All events I import from Google I mark in the database with a flag. When importing from Google I first delete all events in the future and then INSERT all events I retrieve from Google.

To circumvent that the events get new ids with every import I did some hacking (python. It's very hackish, but it solved my case):

    guid_int = "".join(re.findall('[0-9]*', str(vevent.get('UID'))))
    guid_int = guid_int[:9]

guid_int is what I use as the primary key in the database..