Compare commits
No commits in common. "ab92bd54419fc17ffac77a0464420ec4eedee90f" and "57de076fec08874cd6fbbc9935fd8264a47132ef" have entirely different histories.
ab92bd5441
...
57de076fec
|
@ -84,10 +84,6 @@ def story(ref):
|
||||||
s['comments'] = list(filter(bool, s['comments']))
|
s['comments'] = list(filter(bool, s['comments']))
|
||||||
s['num_comments'] = comment_count(s) - 1
|
s['num_comments'] = comment_count(s) - 1
|
||||||
|
|
||||||
if s['score'] < 25 and s['num_comments'] < 10:
|
|
||||||
logging.info('Score ({}) or num comments ({}) below threshold.'.format(s['score'], s['num_comments']))
|
|
||||||
return False
|
|
||||||
|
|
||||||
if 'text' in r and r['text']:
|
if 'text' in r and r['text']:
|
||||||
s['text'] = clean(r['text'] or '')
|
s['text'] = clean(r['text'] or '')
|
||||||
|
|
||||||
|
|
|
@ -103,10 +103,6 @@ def story(ref):
|
||||||
s['comments'] = iter_comments(r['comments'])
|
s['comments'] = iter_comments(r['comments'])
|
||||||
s['num_comments'] = r['comment_count']
|
s['num_comments'] = r['comment_count']
|
||||||
|
|
||||||
if s['score'] < 15 and s['num_comments'] < 10:
|
|
||||||
logging.info('Score ({}) or num comments ({}) below threshold.'.format(s['score'], s['num_comments']))
|
|
||||||
return False
|
|
||||||
|
|
||||||
if 'description' in r and r['description']:
|
if 'description' in r and r['description']:
|
||||||
s['text'] = clean(r['description'] or '')
|
s['text'] = clean(r['description'] or '')
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,7 @@ def story(ref):
|
||||||
logging.info('Group ({}) not in whitelist.'.format(s['group']))
|
logging.info('Group ({}) not in whitelist.'.format(s['group']))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if s['score'] < 15 and s['num_comments'] < 10:
|
if s['score'] < 15 and s['num_comments'] < 15:
|
||||||
logging.info('Score ({}) or num comments ({}) below threshold.'.format(s['score'], s['num_comments']))
|
logging.info('Score ({}) or num comments ({}) below threshold.'.format(s['score'], s['num_comments']))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
import database
|
import database
|
||||||
import search
|
import search
|
||||||
import sys
|
import sys
|
||||||
import settings
|
|
||||||
import logging
|
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import requests
|
import requests
|
||||||
|
@ -23,7 +21,7 @@ def database_del_story(sid):
|
||||||
|
|
||||||
def search_del_story(sid):
|
def search_del_story(sid):
|
||||||
try:
|
try:
|
||||||
r = requests.delete(settings.MEILI_URL + 'indexes/qotnews/documents/'+sid, timeout=2)
|
r = requests.delete(search.MEILI_URL + 'indexes/qotnews/documents/'+sid, timeout=2)
|
||||||
if r.status_code != 202:
|
if r.status_code != 202:
|
||||||
raise Exception('Bad response code ' + str(r.status_code))
|
raise Exception('Bad response code ' + str(r.status_code))
|
||||||
return r.json()
|
return r.json()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user