gcalendar
v0.1.6
Published
Google Calendar SDK
Downloads
3
Readme
gcalendar
Google Calendar SDK
Example
Generate Auth Url
Gcalendar = require('gcalendar')
gcalendar = new Gcalendar
client_id: 'xxxxxxxxxxxx.apps.googleusercontent.com'
client_secret: 'xxxxxxxxxxxxxxxxx-yyyyyy'
redirect_uri: 'http://you.redirect.url/google'
console.log gcalendar.generateAuthUrl()
Get Token
Gcalendar = require('gcalendar')
code = '4/X9GF6aiH7FbB6yyfOidNN48AQ-ng.gkT0lKE1kl0fXE-sT2ZLcbRPHy1khQI' # important!
gcalendar = new Gcalendar
client_id: 'xxxxxxxxxxxx.apps.googleusercontent.com'
client_secret: 'xxxxxxxxxxxxxxxxx-yyyyyy'
redirect_uri: 'http://you.redirect.url/google'
gcalendar.getToken code, (err, tokens) ->
console.log tokens
Call Apis
Gcalendar = require('gcalendar')
gcalendar = new Gcalendar
client_id: 'xxxxxxxxxxxx.apps.googleusercontent.com'
client_secret: 'xxxxxxxxxxxxxxxxx-yyyyyy'
redirect_uri: 'http://you.redirect.url/google'
access_token: 'ya29.1.AADtN_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_yyyyy',
refresh_token: '1/zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'
gcalendar.api('events.list').arguments(
calendarId: '[email protected]'
).execute (err, eventList) ->
console.log eventList