From 3c972da8347c9b3b764113426e99b94e864b0f60 Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Mon, 15 Apr 2019 15:14:37 +0200 Subject: [PATCH] Only search titles when finding previous daily post. --- dailyreleases/reddit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dailyreleases/reddit.py b/dailyreleases/reddit.py index 1ae2e4c..b740e8e 100644 --- a/dailyreleases/reddit.py +++ b/dailyreleases/reddit.py @@ -23,4 +23,5 @@ def submit_post(title, text, subreddit) -> Submission: def get_previous_daily_post(subreddit) -> Submission: logger.info("Getting previous daily post from r/%s", subreddit) - return next(praw.subreddit(subreddit).search("daily release", sort="new", time_filter="week")) + return next(praw.subreddit(subreddit).search('title:"daily releases"', sort="new", syntax="lucene", + time_filter="week"))