https://github.com/rumart/plausible-slack
https://github.com/rumart/plausible-slack
Last synced: 13 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/rumart/plausible-slack
- Owner: rumart
- Created: 2022-02-04T22:40:25.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-01-01T10:17:10.000Z (over 3 years ago)
- Last Synced: 2025-10-06T14:43:40.317Z (10 months ago)
- Language: Python
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# plausible-slack
The script will pull visitor and page view stats for a site from a Plausible host, then do a rudimentary compare against the same day last week and finally post a message to a Slack channel with the results.
Note that the Slack integration expects a [Slack App](https://slack.com/apps) with a [Bot OAuth token](https://api.slack.com/authentication/oauth-v2). The token should be created with ``chat:write`` access to the channel, and the App needs to be added to the channel
The script accepts the environment variables:
- SLACK_TOKEN
- Bot user OAuth Token
- SLACK_CHANNEL
- ID of Slack channel to post message to
- PLAUSIBLE_HOST
- Plausible host that holds your stats, Note! fqdn only
- PLAUSIBLE_TOKEN
- API token for authenticating with Plausible host
- SITE_ID
- Site ID as created in the Plausible host
- LOGLEVEL
- Log level, defaults to INFO
- PERIOD
- Stat period, day or week (last 7 days) supported. Defaults to day
## Run as a container
Pass environments on the command line
```
docker run --rm -e SLACK_TOKEN= -e SLACK_CHANNEL= -e PLAUSIBLE_HOST= -e PLAUSIBLE_TOKEN= -e SITE_ID= rumart/plausibleslack:0.3.0
```
Pass environments in a file
*env.list*
```
LOGLEVEL=debug
PERIOD=week
SLACK_TOKEN=xoxb-xxxxxxxx
SLACK_CHANNEL=Cxxxxxx
PLAUSIBLE_HOST=plausible.xyz
PLAUSIBLE_TOKEN=O-xxxxx
SITE_ID=rudimartinsen.com
```
```
docker run --rm --env-file env.list rumart/plausibleslack:
```
## Build your own container
```
docker build -t plausibleslack: .
```