From d328fc0a7b8b3ed32fcec0a9f9e4f461697b1196 Mon Sep 17 00:00:00 2001 From: lluni Date: Sat, 10 Dec 2022 00:46:15 +0100 Subject: [PATCH] Extracted subreddit into a new env variable --- .env.example | 1 + script.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 5dbf49c..f3fe3df 100644 --- a/.env.example +++ b/.env.example @@ -4,6 +4,7 @@ REDDIT_AUTH_TOKEN="" REDDIT_REFRESH_TOKEN="" REDDIT_CLIENT_ID="" REDDIT_CLIENT_SECRET="" +REDDIT_SUBREDDIT="" MASTODON_URL="" MASTODON_EMAIL="" MASTODON_PASSWORD="" diff --git a/script.py b/script.py index ba7d157..450b6a2 100644 --- a/script.py +++ b/script.py @@ -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