Python谷歌日历API问题
我可以批量向Google日历添加多个事件,但这仅在我的默认日历中。我如何才能获得相同的代码来处理另一个我有URL的日历Python谷歌日历API问题,python,google-calendar-api,bulk,asp.net-web-api,Python,Google Calendar Api,Bulk,Asp.net Web Api,我可以批量向Google日历添加多个事件,但这仅在我的默认日历中。我如何才能获得相同的代码来处理另一个我有URL的日历 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.A
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))
与:
我发现错误:
gaierror: [Errno 11004] getaddrinfo failed
另外请注意,我已经能够使用该URL自行添加事件。查看,似乎:
DEFAULT_BATCH_URL = 'http://www.google.com/calendar/feeds/default/private/full/batch'
在您的代码中,它看起来像是试图解析部分URL。如果将URL格式化为:
url = 'http://www.google.com/calendar/feeds/.../private/full/batch'
它应该可以工作。这几乎是完整的解决方案。我还必须将/batch添加到urlAh的末尾,明白了-我将附加解决方案以供将来参考。很高兴它起作用了。
url = 'http://www.google.com/calendar/feeds/.../private/full/batch'