Working on gcal
This commit is contained in:
@@ -43,10 +43,10 @@ def main():
|
||||
for result in calendar_list:
|
||||
calendarids.append(result.get("id",[]))
|
||||
calendarsummaries.append(result.get("summary",[]))
|
||||
print("result",result.get("summary",[]),result.get("id",[]))
|
||||
print("summaries",calendarsummaries)
|
||||
print("first result",calendar_list[0])
|
||||
print("first result",calendar_list[len(calendar_list)-1])
|
||||
#print("result",result.get("summary",[]),result.get("id",[]))
|
||||
#print("summaries",calendarsummaries)
|
||||
#print("first result",calendar_list[0])
|
||||
#print("first result",calendar_list[len(calendar_list)-1])
|
||||
#result meneelyl@gmail.com meneelyl@gmail.com
|
||||
#result Family family14345103599446093558@group.calendar.google.com
|
||||
#result Meneely Birthdays fjlvq3dnhfvn76ihljocbrhrdc@group.calendar.google.com
|
||||
@@ -62,12 +62,14 @@ def main():
|
||||
# Call the Calendar API
|
||||
now = datetime.datetime.now(tz=datetime.timezone.utc).isoformat()
|
||||
print("Getting the upcoming 10 events")
|
||||
for i in len(calendarids)-1:
|
||||
print("Calendar: ",i,calendarsummaries[i])
|
||||
events_result = (
|
||||
service.events()
|
||||
.list(
|
||||
calendarId="family14345103599446093558@group.calendar.google.com", #"meneelyt@gmail.com", #"ed47cdac4f626432af8c0d1956499d258d0365cf3fe6ee70ce73d7d478b0f1dd@group.calendar.google.com", #"primary",
|
||||
timeMin=now,
|
||||
maxResults=10,
|
||||
maxResults=3,
|
||||
singleEvents=True,
|
||||
orderBy="startTime",
|
||||
)
|
||||
@@ -82,7 +84,7 @@ def main():
|
||||
# Prints the start and name of the next 10 events
|
||||
for event in events:
|
||||
start = event["start"].get("dateTime", event["start"].get("date"))
|
||||
print(start, "--", event["summary"])
|
||||
print(start, event["summary"])
|
||||
|
||||
except HttpError as error:
|
||||
print(f"An error occurred: {error}")
|
||||
|
||||
Reference in New Issue
Block a user