Extracted subreddit into a new env variable

This commit is contained in:
lluni 2022-12-10 00:46:15 +01:00
parent 0c7af6afa6
commit d328fc0a7b
Signed by: lluni
GPG key ID: ACEEB468BC325D35
2 changed files with 2 additions and 1 deletions

View file

@ -4,6 +4,7 @@ REDDIT_AUTH_TOKEN=""
REDDIT_REFRESH_TOKEN=""
REDDIT_CLIENT_ID=""
REDDIT_CLIENT_SECRET=""
REDDIT_SUBREDDIT=""
MASTODON_URL=""
MASTODON_EMAIL=""
MASTODON_PASSWORD=""

View file

@ -26,7 +26,7 @@ mastodon = Mastodon(
# get recent posts to check for duplicates
last_posts = mastodon.account_statuses(getenv("MASTODON_USER_ID"), limit=15)
for submission in reddit.subreddit("ich_iel").top(time_filter="day", limit=10):
for submission in reddit.subreddit(str(getenv("REDDIT_SUBREDDIT"))).top(time_filter="day", limit=10):
# skip post if it is a stickied post
if (submission.stickied):
continue