Added ability to add tags to post
This commit is contained in:
parent
cb534d87b2
commit
3008b854f6
3
main.py
3
main.py
@ -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')
|
TOOT_VISIBILITY = os.environ['TOOT_VISIBILITY'] # Toot visibility ('public', 'unlisted', 'private', or 'direct')
|
||||||
# RSS feed URL
|
# RSS feed URL
|
||||||
RSS_FEED_URL = os.environ['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
|
# File to store the processed entry URLs. Note that /state directory is for the docker setup
|
||||||
PROCESSED_ENTRIES_FILE = '/state/processed_entries.txt'
|
PROCESSED_ENTRIES_FILE = '/state/processed_entries.txt'
|
||||||
@ -55,7 +56,7 @@ def check_and_post_new_items():
|
|||||||
if entry_url not in processed_entries:
|
if entry_url not in processed_entries:
|
||||||
print(f"Found a new RSS item: {entry.title}")
|
print(f"Found a new RSS item: {entry.title}")
|
||||||
# Create a Mastodon status
|
# 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
|
# Post the status to Mastodon
|
||||||
mastodon.status_post(status, visibility=TOOT_VISIBILITY)
|
mastodon.status_post(status, visibility=TOOT_VISIBILITY)
|
||||||
|
Loading…
Reference in New Issue
Block a user