https://github.com/fedebertolini/personio-slack-bot
Slack bot that fetches today's events from Personio and posts a summary to a Slack channel
https://github.com/fedebertolini/personio-slack-bot
Last synced: about 1 year ago
JSON representation
Slack bot that fetches today's events from Personio and posts a summary to a Slack channel
- Host: GitHub
- URL: https://github.com/fedebertolini/personio-slack-bot
- Owner: fedebertolini
- License: mit
- Created: 2017-10-22T14:45:14.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-04-19T08:23:37.000Z (about 3 years ago)
- Last Synced: 2024-04-14T23:55:37.560Z (about 2 years ago)
- Language: JavaScript
- Size: 48.8 KB
- Stars: 7
- Watchers: 1
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# personio-slack-bot
NodeJS app that fetches today's events from [Personio](https://www.personio.de/) and posts a
summary to a [Slack](https://slack.com/) channel.
It also gets one of the current [Days of the year](https://www.daysoftheyear.com/) to use in
the Slack message.
## Installation
First install the node dependencies:
`npm install` or `yarn install`.
Then create a `.env` file (you can use [.env.dist](https://github.com/fedebertolini/personio-slack-bot/blob/master/.env.dist)
as an example). You need to add these environment variable definitions:
- `SLACK_HOOK_URL`: Slack's hook URL that will be used to post messages to Slack.
- `SLACK_CHANNEL`: Slack's channel where the event report is going to be sent to.
- `PERSONIO_CALENDARS`: List of calendar identifiers separated by comma. For each calendar id defined
in this list you need to add another two environment variable definitions:
- `PERSONIO_URL_{CALENDAR_ID}`: Personio's _iCalendar_ link. You can get this link by going to the
Personio's Calendar page, cliking the `ICAL` button, then changing the filters you want and finally
copying the link.
- `PERSONIO_MESSAGE_{CALENDAR_ID}`: When the events are posted to Slack, these are grouped by Calendar
ID. This env variable defines the group's header.
- `IGNORE_LIST` (optional): comma separated list of employee names that should be ignored.
## Usage
Run `npm run start`.
## Example
`.env` file:
```
SLACK_HOOK_URL=https://hooks.slack.com/services/ABCDEF
SLACK_CHANNEL=general
PERSONIO_CALENDARS=BIRTHDAY,VACATION
PERSONIO_URL_BIRTHDAY=https://my-company.personio.de/calendar/ical/123456/birthdays/0/calendar.ics
PERSONIO_URL_VACATION=https://my-company.personio.de/calendar/ical/123456/vacations/0/calendar.ics
PERSONIO_MESSAGE_BIRTHDAY=:birthday: *Birthday* :birthday:
PERSONIO_MESSAGE_VACATION=:palm_tree: *Vacation* :palm_tree:
```
Slack message:
```
Sunday 22nd of October - Nut Day
:birthday: *Birthday* :birthday:
- Jane Doe
:palm_tree: *Vacation* :palm_tree:
- Federico Bertolini
- John Doe
```