既然RSS已從Google日曆中刪除,我一直在尋找一個簡單的替代品。我在Google Calendar API中挖掘並發現了以下內容:calendar.events.list
Calendar Events List in Google API Explorer是開始使用不同參數和選項的好地方 - 它會爲您構建示例請求字符串。您可以看到我指定了2/5/2016的最短時間,按開始時間排序,並顯示已刪除的事件。
GET https://www.googleapis.com/calendar/v3/calendars/[CALENDAR ID HERE]/events?
orderBy=startTime&showDeleted=true&singleEvents=true&
timeMin=2016-02-05T00%3A00%3A00Z&key={YOUR_API_KEY}
結果是在JSON中,所以你可以用你最喜歡的編程語言,ASP.NET或任何其他語言解析它。結果如下:
{
"kind": "calendar#events",
"etag": "\"123456789123456\"",
"summary": "My Public Calendar",
"updated": "2016-01-29T14:38:29.392Z",
"timeZone": "America/New_York",
"accessRole": "reader",
"defaultReminders": [ ],
"items": [ {
"kind": "calendar#event",
"etag": "\"987654\"",
"id": "sfdljgsdkjgheakrht4sfdjfscd",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=sdgtukhysrih489759sdkjfhwseihty7934hyt94hdorujt3q95uy689u9yhfdgnbiwe5hy",
"created": "2015-07-06T16:21:59.000Z",
"updated": "2015-07-06T16:21:59.329Z",
"summary": "In-Service Day",
"location": "Maui, HI",
"creator": {
"email": "[email protected]",
"displayName": "Joe Abra"
},
"organizer": {
"email": "[email protected]",
"displayName": "My Public Calendar",
"self": true
},
"start": {
"date": "2016-02-08"
},
"end": {
"date": "2016-02-09"
},
"transparency": "transparent",
"iCalUID": "[email protected]",
"sequence": 0
},
{
...
}]
}