|
|
@@ -131,7 +131,7 @@ def process_post(post): |
|
|
|
} |
|
|
|
|
|
|
|
def query_tops(config): |
|
|
|
url = 'https://www.reddit.com/r/%s/top.json?sort=top&t=day' % config['subreddit'] |
|
|
|
url = 'https://www.reddit.com/r/%s/hot.json' % config['subreddit'] |
|
|
|
resp = requests.get(url, headers = {'User-agent': 'mastoreddit'}) |
|
|
|
resp.raise_for_status() |
|
|
|
j = resp.json() |
|
|
@@ -162,13 +162,16 @@ def filter_posts(config, posts, filt): |
|
|
|
if len(ok) <= tp and p['score'] >= config['min_score']: |
|
|
|
if p['rid'] not in filt: |
|
|
|
ok.append(p) |
|
|
|
newfilt.add(p['rid']) |
|
|
|
else: |
|
|
|
print('filtered out:', p['rid'], p['title']) |
|
|
|
elif p['rid'] in filt: |
|
|
|
newfilt.add(p['rid']) |
|
|
|
else: |
|
|
|
print('skipped:', p['rid'], p['title']) |
|
|
|
continue |
|
|
|
|
|
|
|
if p['rid'] in filt: |
|
|
|
newfilt.add(p['rid']) |
|
|
|
continue |
|
|
|
|
|
|
|
print('ignoring for now:', p['rid'], p['title']) |
|
|
|
|
|
|
|
return ok, list(newfilt) |
|
|
|
|