0
我可以批量向Google日历添加多个活动,但这仅限于我的默认日历。我将如何获得相同的代码来处理另一个具有URL的日历?Python Google日历API问题
request_feed = gdata.calendar.CalendarEventFeed()
# add events to the request_feed
request_feed.AddInsert(entry=InsertSingleEvent(calendar_service, "walk the dog at 4:00pm"))
request_feed.AddInsert(entry=InsertSingleEvent(calendar_service, "walk the cat at 5:00pm"))
response_feed = calendar_service.ExecuteBatch(request_feed,
gdata.calendar.service.DEFAULT_BATCH_URL))
这会正常工作,所有事件都会在我的日历中显示。但是,当我更换:
response_feed = calendar_service.ExecuteBatch(request_feed,
gdata.calendar.service.DEFAULT_BATCH_URL))
有了:
url = 'calendar/feeds/.../private/full'
response_feed = calendar_service.ExecuteBatch(request_feed,
url))
我得到的错误:
gaierror: [Errno 11004] getaddrinfo failed
同时请注意,我已经能够使用该网址自行添加事件。
这几乎是完整的解决方案。我还必须在url的末尾添加/批处理 – bs7280 2012-08-16 00:42:42
呃,呃 - 我会追加解决方案以备将来参考。很高兴它的工作。 – RocketDonkey 2012-08-16 00:54:31