Google Calendar feed api deleted events

岁酱吖の 提交于 2019-12-22 07:05:02

问题


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:


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

Check this thread for further information.




回答2:


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



来源:https://stackoverflow.com/questions/2584978/google-calendar-feed-api-deleted-events

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!