Coder Social home page Coder Social logo

bimalpaul / mmm-googlebirthdaysprovider Goto Github PK

View Code? Open in Web Editor NEW

This project forked from palatincoder/mmm-googlebirthdaysprovider

0.0 1.0 0.0 274 KB

MagicMirror² Module to include your Google Contacts' birthdays into the default calendar

License: BSD 3-Clause "New" or "Revised" License

JavaScript 100.00%

mmm-googlebirthdaysprovider's Introduction

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).

mmm-googlebirthdaysprovider's People

Contributors

palatincoder avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.