Based on this example, I found here I want to get icalendar data and process it. This is my code so far:
from datetime import datetime, timedelta
from icalendar import Calendar
import urllib
import time
ics = urllib.urlopen('https://www.google.com/calendar/ical/xy/basic.ics').read()
ical1 = Calendar.from_ical(ics)
for vevent in ical1.subcomponents:
if vevent.name == "VEVENT":
title = str(vevent.get('SUMMARY').encode('utf-8'))
start = vevent.get('DTSTART').dt
end = vevent.get('DTEND').dt
print title
print start
print end
print type(start)
print "---"
Gets the title and starts + the end date from my Google calendar. This work and conclusion are as follows:
This is a Test Title
2012-12-20 15:00:00+00:00
2012-12-20 18:00:00+00:00
<type 'datetime.datetime'>
---
Another Title
2012-12-10
2012-12-11
<type 'datetime.date'>
---
...
, datetime.datetime datetime.date. , Google 2 ( datetime.date) , . 3 ( datetime.datetime. / 4 . (, ), , ? "" , . " + 4 ", "4 ".