Skip to content

Commit

Permalink
bots: run tlg wotd on social.krebsco.de
Browse files Browse the repository at this point in the history
  • Loading branch information
kmein committed Nov 26, 2024
1 parent 56e44e9 commit 61ec35a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions configs/bots/tlg-wotd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
config,
niveumPackages,
...
}: {
}: let
mastodonEndpoint = "https://social.krebsco.de";
in {
systemd.services.bot-tlg-wotd = {
enable = true;
wants = ["network-online.target"];
Expand Down Expand Up @@ -122,12 +124,12 @@
-F parse_mode=Markdown \
-F caption="$telegram_caption"
mastodon_upload_response=$(curl -X POST "https://botsin.space/api/v2/media" \
mastodon_upload_response=$(curl -X POST "${mastodonEndpoint}/api/v2/media" \
-H "Authorization: Bearer $MASTODON_TOKEN" \
-F "file=@$photo_path" \
-F "description=$word ‘$definition’")
mastodon_image_id=$(echo $mastodon_upload_response | jq -r .id)
curl -X POST "https://botsin.space/api/v1/statuses" \
curl -X POST "${mastodonEndpoint}/api/v1/statuses" \
-H "Authorization: Bearer $MASTODON_TOKEN" \
-d "status=$mastodon_caption" \
-d "visibility=public" \
Expand Down
2 changes: 1 addition & 1 deletion secrets
Submodule secrets updated from 08e9e1 to 6c23ca

0 comments on commit 61ec35a

Please sign in to comment.