views:

86

answers:

2

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?

+1  A: 

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

Check this thread for further information.

systempuntoout
perfect! thanks!
hsmit
You are welcome.
systempuntoout
A: 

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..

Philipp Keller
this is not what I asked for, but thanks for your reply
hsmit