Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
/ gcal-slack-update Public archive

Gcal ➔ Slack: Automatically update your Slack status according to the current Google Calendar event

License

Notifications You must be signed in to change notification settings

hugocf/gcal-slack-update

Repository files navigation

status version

Gcal ➔ Slack

gcal-slack-update automatically changes your status in multiple Slack teams, depending on the current event in your Google Calendar.

It is designed to run periodically from a cron job and, during each execution, it checks whether the current event Title in Google Calendar contains the match-text defined in the set of configuration rules received as input.

Example of an input file in rules-example.conf:

rules = [
  {
    match-text = "testing this"
    status-emoji = ":smile:"
    status-text = "It works"
  }, 
  {
    match-text = "another test"
    status-emoji = ":+1:"
    status-text = "Count me in"
  },
]
Configurations Description Maps to…
match-text Case insensitive string which can appear anywhere in the searched field Google Calendar: Event Title
status-emoji The symbol to display as the status Slack: Status Emoji
status-text The status’ description (can also contain emojis) Slack: Status Text

Authentication is read from a file named auth.conf (see example in auth-example.conf):

slack-token = "xoxp-legacy-token"

To generate such a token, go to the legacy tokens Slack page of the workspace where you wish to update the status.

Local Installation

  • Get latest release from the repo releases page and unzip it to some location
  • Make sure the execution script has execute permissions: chmod a+x bin/gcal-slack-update
  • Copy file auth-example.conf into auth.conf and update with your token for Slack
  • Copy file to rules.conf and customise it to your needs, as you prefer
  • Periodically run the command ./bin/gcal-slack-update rules.conf with the frequency you wish to update status

Ideas 💡

  • Change status in multiples Slack teams simultaneously!
  • Support multiple Google Calendars?
  • Search for matches in other event fields? (e.g. description, location)
  • Support regex patterns to match events?
  • Configure sbt-native-packager to ensure that the universal script files in ./bin have execute permissions

About

Gcal ➔ Slack: Automatically update your Slack status according to the current Google Calendar event

Topics

Resources

License

Stars

Watchers

Forks

Packages