2 Commits

Author SHA1 Message Date
7fe2a1de00 chore(app): Release v0.9.6
All checks were successful
Build and Push Docker Image on Tag / build_and_push (push) Successful in 30s
Create Release / release (push) Successful in 10s
2025-06-01 14:38:19 +02:00
8f5813b39c fix(app): Add title to mastodon post 2025-06-01 13:49:25 +02:00
2 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,5 @@
FROM python:3.11-slim
LABEL version="0.9.0"
LABEL version="0.9.6"
RUN apt-get update && apt-get install -y curl && apt-get clean && rm -rf /var/lib/apt/lists/*

View File

@ -137,8 +137,12 @@ def save_seen_id(post_id):
f.write(post_id + "\n")
def post_to_mastodon(message):
def post_to_mastodon(title, link, tags):
mastodon = Mastodon(access_token=MASTODON_TOKEN, api_base_url=MASTODON_BASE_URL)
hashtags = " ".join(f"#{tag}" for tag in tags) if tags else ""
message = f"{title}\n\n{link}"
if hashtags:
message += f"\n\n{hashtags}"
mastodon.toot(message)
@ -257,7 +261,7 @@ def main():
try:
if POST_TARGETS in ("mastodon", "both"):
post_to_mastodon(message)
post_to_mastodon(title, link, tags)
time.sleep(2)
if POST_TARGETS in ("bluesky", "both"):