Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
7fe2a1de00
|
|||
8f5813b39c
|
@ -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/*
|
||||
|
||||
|
@ -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"):
|
||||
|
Reference in New Issue
Block a user