Dashing widget to display the next and some subsequent Google Calendar events using the Google Calendar API v3.
I use this widget to display my shift calendar - see the screenshot below
This widget works with API v3 and requires a service account to be set up via the Google Developer's Console. Once a project is set up, enable the Calendar API. On the Credentials page create a new OpenID and download the p12 key file - set up the path to this file in the job file and grant the email address access to the relevant calendar.
The job file defines how many events to get from the calendar and when to start the search. My version gets the next 6 events.
Add to Gemfile:
gem 'google-api-client', '>= 0.8'
Run
bundle install
Download the Moment javascript library and add to your javascript assets. Add #= require moment.js
to the application.coffee script. You can also use moment.min.js
if you've downloaded that.
I got the same problem as @michaelgra
/google_calendar.rb:25:in `initialize': can't convert nil into String (TypeError)
The path to the p12 file has to be the comple path including the dashing path or only the path out of the dashboard path? (/jobs/p12.p12 or /opt/mydashboardproject/jobs/p12.12 ? )
tried both, but it didnt fix the error.
maybe i did something wrong in here?:
Update these to match your own apps credentials
service_account_email = '[email protected]' # Email of service account
key_file = '/opt/mydashboardproject/dashing-google-p12.p12' # File containing your private key
key_secret = 'notasecret' # Password to unlock private key
calendarID = 'BLACKENED%40group.calendar.google.com' # Calendar ID.
BLACKENED: i replaced the numbers and letters with BLACKENED ...
Any idea?