Open DougAtPraxent opened 6 years ago
Created calendar-events.html -- a standalone page based on quickstart.html, where I worked out the details of (and calculations based on) the calendar event data we need. Then created gCal.js that generalized the login/authentication and added a 'listMyCalendarEvents(fromDate, toDate)' method to return the logged-in user's calendar event data for the given date range in JSON format
Google Calendar API JavaScript Quickstart https://developers.google.com/calendar/quickstart/js
Confirm Python 2.4+ available for web server ('python --version' => v2.7 installed in my local environment); then 'python -m SimpleHTTPServer 8000' in the project directory
Create a project in the Google Developers Console and turn on the Google Calendar API
Set up OAuth credentials 'eventry-client' client ID = '984026966977-5bgo5545bhtrktnqlc4f8pg9g21f6m1h.apps.googleusercontent.com' client secret = 'cjnekZvOgDIDREA1SwNbDhwH'
Create API key API key = 'AIzaSyDo30LSgpGD6aySTVekJawO6hiTpK0RFco'
Note: Restrict access to the API key to specific websites, IP addresses or mobile apps in production
Create 'quickstart.html' file
Replace '' and '' placeholders in the code
Start the web server (python -m SimpleHTTPServer 8000) from the working directory (/Eventry) where the 'quickstart.html' file is saved
Navigate to http://localhost:8000/quickstart.html in your browser
Note: The first time you run the sample, it will prompt you to authorize access
Note: After the initial user authorization, calls to 'gapi.auth.authorize that use 'immediate:true' mode will obtain an auth token without user interaction
SUCCESS!!!