Calendar for all things Princeton
The app uses Node.js. In addition, it requires a few packages to be installed to run.
npm install googleapis --save
npm install google-auth-library --save
npm install chrono-node --save
Because the app uses Gmail API and Google Calendar API, it is necessary to get authorization from the account to read/write emails and calendar events. Here are the steps to setup the API from API Quickstart:
- Use this wizard to create or select a project in the Google Developers Console and automatically turn on the API. Click Continue, then Go to credentials.
- On the Add credentials to your project page, click the Cancel button.
- At the top of the page, select the OAuth consent screen tab. Select an Email address, enter a Product name if not already set, and click the Save button.
- Select the Credentials tab, click the Create credentials button and select OAuth client ID.
- Select the application type Other, enter the name "Gmail API Quickstart", and click the Create button.
- Click OK to dismiss the resulting dialog.
- Click the download button to the right of the client ID.
- Move this file to your working directory and rename it client_secret.json.
node app.js
When the app is run for the first time, you need to authorize access for reading and writing emails and calendar events. Here are the steps to authorize access from API Quickstart.
- Browse to the provided URL in your web browser.
- If you are not already logged into your Google account, you will be prompted to log in. If you are logged into multiple Google accounts, you will be asked to select one account to use for the authorization.
- Click the Accept button.
- Copy the code you're given, paste it into the command-line prompt, and press Enter.
The credentials are saved in a folder called credentials in the home directory with the name gmail-calendar-nodejs-tigercal.json.