move reddit thresholds as settings variables.

This commit is contained in:
Jason Schwarzenberger 2020-11-16 10:11:39 +13:00
parent 7420b5ece9
commit b23e470317
2 changed files with 5 additions and 1 deletions

View File

@ -73,7 +73,7 @@ def story(ref):
s['comments'] = list(filter(bool, s['comments'])) s['comments'] = list(filter(bool, s['comments']))
s['num_comments'] = r.num_comments s['num_comments'] = r.num_comments
if s['score'] < 25 and s['num_comments'] < 10: if s['score'] < settings.REDDIT_SCORE_THRESHOLD and s['num_comments'] < settings.REDDIT_COMMENT_THRESHOLD:
return False return False
if r.selftext: if r.selftext:

View File

@ -31,6 +31,10 @@ REDDIT_CLIENT_ID = ''
REDDIT_CLIENT_SECRET = '' REDDIT_CLIENT_SECRET = ''
REDDIT_USER_AGENT = '' REDDIT_USER_AGENT = ''
# Minimum points or number of comments before including a thread:
REDDIT_COMMENT_THRESHOLD = 10
REDDIT_SCORE_THRESHOLD = 25
SUBREDDITS = [ SUBREDDITS = [
'Economics', 'Economics',
'AcademicPhilosophy', 'AcademicPhilosophy',