0
使用gdata API for Python,如何創建或列出默認日曆以外的日曆中的事件?如何使用Google的Python for API在日曆以外的日曆中創建/列出事件?
使用gdata API for Python,如何創建或列出默認日曆以外的日曆中的事件?如何使用Google的Python for API在日曆以外的日曆中創建/列出事件?
您必須獲取要讀取/寫入的自定義日曆的url,並在事件查詢中提供它。這就是我想出的:
#define cal_client:
self.cal_client = gdata.calendar.client.CalendarClient(source='Milosz-GCal-1.0')
#initiate calendar service (log in):
self.cal_client.ClientLogin(email, password, self.cal_client.source);
#get url for custom calendar (cal_index):
self.cal_url=self.cal_client.GetOwnCalendarsFeed().entry[self.cal_index].GetAlternateLink().href
#then, to read from the custom calendar:
self.feed=self.cal_client.GetCalendarEventFeed(self.cal_url)
#and to write to custom calendar:
new_event = self.cal_client.InsertEvent(event,self.cal_url)