Added ability to add tags to post

This commit is contained in:
Brad Ganley 2024-02-11 14:12:59 -06:00
parent cb534d87b2
commit 3008b854f6

View File

@ -10,6 +10,7 @@ MASTODON_INSTANCE_URL = os.environ['MASTODON_INSTANCE_URL']
TOOT_VISIBILITY = os.environ['TOOT_VISIBILITY'] # Toot visibility ('public', 'unlisted', 'private', or 'direct')
# RSS feed URL
RSS_FEED_URL = os.environ['RSS_FEED_URL']
POST_TAGS = os.environ['POST_TAGS']
# File to store the processed entry URLs. Note that /state directory is for the docker setup
PROCESSED_ENTRIES_FILE = '/state/processed_entries.txt'
@ -55,7 +56,7 @@ def check_and_post_new_items():
if entry_url not in processed_entries:
print(f"Found a new RSS item: {entry.title}")
# Create a Mastodon status
status = f"\n{entry.title}\n\n{entry.link}"
status = f"\n{entry.title}\n\n{entry.link}\n\n{POST_TAGS}"
# Post the status to Mastodon
mastodon.status_post(status, visibility=TOOT_VISIBILITY)