Skip to content

Retrieve events from Google Calendar and post to a Slack channel.

Notifications You must be signed in to change notification settings

cvzero89/googlecal-slack

Repository files navigation

googlecal-slack

Retrieve events from Google Calendar and post to a Slack channel.

alt text

Follow the steps from: https://developers.google.com/calendar/api/quickstart/python making sure to activate the Google Calendar API and that you will need to publish the app for Google to trust it.

Move credentials.json to the script folder.

First runs looks like:

python3 calendarApp.py dailyEvents team
Creating calendar service...
Please visit this URL to authorize this application: https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=-.......
Received 1 events.
Message sent. Server response: ok

Your browser should open to authorize the app. If not, copy the link and open it on a browser. After a successful login the script will run.

Sample of configuration file:

team:
    type_of_event:
        slackURL: "string"
        calendarId: "string"
        maxResults: bool
        text: "string"
        exclude: "string"

slackURL can be created by following the steps on this link: https://api.slack.com/messaging/webhooks.
calendarId can be retrieved from the Google Calendar > Settings > Settings for calendars. Main calendars are called primary.
maxResults limit the number of events to show. If set to False it will get all available events during the task timeframe.
text Text to add at the top of the message in Slack.
exclude using reGex to remove events.

About

Retrieve events from Google Calendar and post to a Slack channel.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages