Go program that goes out to the Teknisk Ukeblad web and downloads todays Lunch and Dunce cartoons, and Dilbert - while supplies last[1] - then sends the URL to your Slack channel. The cartoons are in Norwegian.
New! Also supports downloading XKCD - will use a key/value pair at kvdb.io to track the last comic that was downloaded, and only download newer ones.
The original idea is mine, but I have used various resources in implementing the solution. Learning Go along the way.
You should probably avoid spamming the tu.no website, as they might react with breaking changes.
[1] Dilbert was cancelled following the Scott Adams controversy.
- Get your Slack Incoming Webhook URL set up.
- Set up your kvdb.io bucket, ie like this
curl -d '[email protected]' https://kvdb.io
- Install Golang. Or just run the bot in a Github workflow. See
.github/workflows
for examples. - Set environment variable as below, or in a
.env
file for automatic inclusion:
WEBHOOK_URL="https://hooks.slack.com/services/THIS/IS/PRIVATE"
KVDB_BUCKET="yourBucketId"
- Set a key in your KVDB bucket to the comic id of the XKCD comic you want to start tracking from. As of this writing the current comic is 2752.
curl https://kvdb.io/yourBucketId/xkcd -d '2752'
- Run the bot with
go run .
This should download the images of the current comics to pwd
, and post their URLs to Slack.
- Build the image
docker build --tag comicbot .
- Run the container
docker run --env WEBHOOK_URL="<your-slack-webhook-url>" comicbot
First login to Dockerhub with docker login
- Build the image and tag appropriately
docker build --tag <repository>/comicbot:latest .
- Push the image to the repository
docker push <repository>/comicbot:latest