A Dashing widget for displaying the number of attendees for a specific calendar event on Google Calendar
It's specially designed to be used against a recursive event. For example, we use it at platanus to show how many people and who is going to have lunch in the office.
Made by platanus in Chile
google-api-ruby-client rails/activesupport
Add it to dashing's gemfile:
gem 'google-api-client'
gem 'activesupport'
and run bundle install
.
To use this widget, you'll first need to set up a Google API project.
-
- Go to https://code.google.com/apis/console
- Click 'Create Project'
- Enable 'Analytics API' service and accept both TOS's
- Click 'API Access' in the left-hand nav menu
- Click 'Create an OAuth 2.0 Client ID'
- Enter a product name (e.g. Dashing Widget) - logo and url are optional
- Click 'Next'
- Under Application Type, select 'Service Account'
- Click 'Create Client ID'
- Click 'Download private key' NOTE: This will be your only opportunity to download this key.
- Note the password for your new private key ('notasecret')
- Close the download key dialog
- Find the details for the service account you just created and copy it's email address which will look something like this:
[email protected]
- you'll need it in environmental variables later
-
-
You can install the widget with
dashing install 2f0b6010d6ffab479d61
, or manually add each file in the corresponding location -
Setup your environmental variables
GOOGLE_SERVICE_ACCOUNT_EMAIL # Email of service account GOOGLE_SERVICE_PK_FILE # File containing your private key GOOGLE_SERVICE_KEY_SECRET # Password to unlock private key 'notasecret' ATTENDEE_CALENDAR_ID # Calendar ID. ATTENDEE_EVENT_ID # Event ID DEFAULT_GRAVATAR # Url to image to show as default when no gravatar NEXT_EVENT_TIME # Time to start showing the next event 'America/Los Angeles'
-
Add the widget HTML to your dashboard
<li data-row="1" data-col="4" data-sizex="1" data-sizey="1"> <div data-id="attendees" data-view="Attendees" data-today-message="Today lunch" data-tomorrow-message="Tomorrow lunch" data-no-event-message="No lunch" data-updatedAtMessage="Updated"></div> <i class="fa fa-cutlery icon-background"></i> </li>
-
To set your PK12 certificate in heroku you can follow this guide http://ar.zu.my/how-to-store-private-key-files-in-heroku/