A python asynchronous worker which subscribe to twitter or mastodon accounts and hashtags and send them to Slack, Discord, Mastodon or Uprodit.
It pulls the twitter API every minutes (you can configure the pool period in the environment's variables) and filter the result to a list of twitter accounts and hashtags.
It also uses redis for storing tweets already processed during 48h (you can configure the TTL in the environment variables).
This worker also provide a Restful API for monitoring purpose.
The variables available are listed in the .env.dist file.
Notes:
- The difference between
SLACK_TOKEN
andSLACK_PUBLIC_TOKEN_X
is the following: the errors will also be published withSLACK_TOKEN
. - In order to use discord instead of slack, you just have to replace the variable
SLACK_TOKEN
byDISCORD_TOKEN
orSLACK_PUBLIC_TOKEN_X
byDISCOVER_PUBLIC_TOKEN_X
. You can also use both (you'll have to define all variables). STREAM_PRIMARY_SRC
indicate the primary source and can taketwitter
ormastodon
as value in order to avoid infinite loop (defaulttwitter
).- Every accounts defined with the
TWITTER_OWNER_X
environments variables muste be also defined with theTWITTER_USERNAME_X
environments variables. Only the owners will be able to be mirrored on Mastodon, Twitter or Uprodit (the username that are not owner will be mirrored on Slack or Discord with aFrom {{username }} at {{ date_iso }}
mention).
- Main repo: https://gitlab.comwork.io/oss/social-bridge
- Github mirror: https://github.com/comworkio/social-bridge.git
- Gitlab mirror: https://gitlab.com/ineumann/social-bridge.git
The image is available and versioned here: https://hub.docker.com/r/comworkio/social-bridge
You'll find tags for arm32/aarch64 (optimized for raspberrypi) and x86/amd64 tags:
$ cp .env.dist .env # replace the environment values in this file
$ docker-compose -f docker-compose-local.yml up --force-recreate
And if you want to change the python sources, don't forget to rebuild:
$ cp .env.dist .env # replace the environment values in this file
$ docker-compose -f docker-compose-local.yml up --force-recreate --build
$ curl localhost:8080/v1/health
{"status": "ok", "alive": true}
$ curl localhost:8080/v1/manifest
{"version": "1.0", "sha": "1c7cb1f", "arch": "x86"}
This is a webhook for betteruptime incidents:
curl -X POST localhost:8080/v1/betteruptime -d '{"data":{"name": "cwcloud", "url":"https://cloud.comwork.io","cause": "not responding", "started_at": "2022-12-22T06:19:57.802Z"}}'