move reddit thresholds as settings variables.

master
Jason Schwarzenberger 4 years ago
parent 7420b5ece9
commit b23e470317
  1. 2
      apiserver/feeds/reddit.py
  2. 4
      apiserver/settings.py.example

@ -73,7 +73,7 @@ def story(ref):
s['comments'] = list(filter(bool, s['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
if r.selftext:

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

Loading…
Cancel
Save