Skip to content
MagicMirror² Module to include your Google Contacts' birthdays into the default calendar
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode style: line endings Nov 19, 2018
google-api-credentials feat(people api): Add a script to get an auth token Dec 1, 2018
test
.gitignore feat(people api): Add a script to get an auth token Dec 1, 2018
.release-it.json chore(package): dependency updates Jan 11, 2019
.travis.yml chore(travis): test against node 8 Oct 22, 2018
LICENSE.md style: line endings Nov 19, 2018
MMM-GoogleBirthdaysProvider.js refactor: remove leftover test code Oct 30, 2018
README.md fix: event title only contains person's name Jan 13, 2019
google-api-helper.js feat(ical): actual birthday events from the People API in the ical feed Dec 1, 2018
node_helper.js fix: event title only contains person's name Jan 13, 2019
package-lock.json chore(release): v0.2.0 Jan 13, 2019
package.json chore(release): v0.2.0 Jan 13, 2019
screenshot.png docs(readme): add instructions for GCP setup and MVP release Dec 3, 2018

README.md

GoogleBirthdaysProvider

A MagicMirror² helper to include the birthdays of your Google Contacts in the default calendar.

GitHub tag Travis License

🛠 Work in progress

The module is kind of a MVP (minimum viable product) at the moment. That means you can use it in your setup, but things will definitely change on the way to v1.0. Also, be aware that there are some known issues! Use it with care 😉

How it works

The module reads the birthdays of your Google Contacts via Google's People API and exposes them as an iCal Feed through an internal URL, so you can include it in the default calendar.

Screenshot

Prerequisites

You need to have a project setup on Google Cloud Platform for your mirror. If you use other Google Services (like the Directions API with MMM-MyCommute), you most likely already have a project.

To enable the People API:

  1. Visit the API Library and click "Enable". Make sure you have the right project selected in the top menu.

After the API is enabled, you need to create credentials for the module.

  1. From the Overview of the People API, select "Credentials" on the left.
  2. Click the button "Create credentials" and choose "OAuth client ID"
  3. Select "Other" and give the client a recognizable name, like "MMM-GoogleBirthdaysProvider"
  4. Click "Create"

You should be redirected to the credentials overview

  1. Download the newly created credentials and set the file aside for now, you'll need it in a moment.

Installation

  1. In your modules/ directory, git clone https://github.com/PalatinCoder/MMM-GoogleBirthdaysProvider.git

  2. cd in the new MMM-GoogleBirthdaysProvider directory

  3. npm install --production (note the production flag, so you don't get all the dev dependencies - you don't need them if you just want to use the module)

  4. Place the JSON file with the credentials (from step 6 above) in google-api-credentials/credentials.json

  5. Run npm run token:generate and follow the instructions. This will authorize your instance of the module against your GCP project and store an authorization token.

  6. Add the module to your config.js:

    {
        module: "MMM-GoogleBirthdaysProvider",
        config: {}
    },
    

    Note: Don't give the module a position, as it doesn't render any DOM at all

  7. Add http://localhost:8080/mmm-googlebirthdaysprovider to your calendar URLs, something like this:

    (...)
     	{
     		module: "calendar",
     		position: "top_left",
     		config: {
     			calendars: [
     				{
     					url: 'http://localhost:8080/mmm-googlebirthdaysprovider',
     					symbol: 'birthday-cake',
     					color: '#f00'
     				}
     			]
     		}
     	}
    (...)
    
  8. (optional) If you want to see which birthday it is, set the following:

    Config Options

    Set `displayRepeatingCountTitle` to `true` and set the suffix for the count in the `repeatingCountTitle` in the calendar's options, like so:

    (...)
     	{
     		module: "calendar",
     		position: "top_left",
     		config: {
     			displayRepeatingCountTitle: true,
     			calendars: [
     				{
     					url: 'http://localhost:8080/mmm-googlebirthdaysprovider',
     					symbol: 'birthday-cake',
     					repeatingCountTitle: "Birthday"
     					color: '#f00'
     				}
     			]
     		}
     	}
    (...)
    

  9. That's it, now have fun 😉

Known Limitations / Issues

  • Birthdays are only fetched once, when the node_helper is initialized. Should do that regularly
  • Birthdays which don't have a year set are automatically set to the current year (at the time of fetching the data). That means you won't see birthdays in January during December
  • By now, all birthday events are set to the current year, thus you won't see next year's birthdays untils new years day
  • Only one google account is supported
  • there is no pagination implemented for the data returned by Google People API. Thus, the maximum number of contacts available is 2000 (hard limit on google's side).
You can’t perform that action at this time.