forked from tanner/qotnews
remove limit.
This commit is contained in:
parent
7b8cbfc9b9
commit
c1b7877f4b
|
@ -79,8 +79,7 @@ def get_stories(maxage=60*60*24*2):
|
||||||
join(Story).\
|
join(Story).\
|
||||||
filter(Story.title != None).\
|
filter(Story.title != None).\
|
||||||
filter(Story.meta['date'] > time).\
|
filter(Story.meta['date'] > time).\
|
||||||
order_by(Story.meta['date'].desc()).\
|
order_by(Story.meta['date'].desc())
|
||||||
limit(amount)
|
|
||||||
return [x[1] for x in q]
|
return [x[1] for x in q]
|
||||||
|
|
||||||
def put_ref(ref, sid, source):
|
def put_ref(ref, sid, source):
|
||||||
|
|
|
@ -12,11 +12,7 @@ import settings
|
||||||
from feeds import hackernews, reddit, tildes, substack, manual, news
|
from feeds import hackernews, reddit, tildes, substack, manual, news
|
||||||
from scrapers import outline, declutter, local
|
from scrapers import outline, declutter, local
|
||||||
|
|
||||||
ONE_HOUR = 60*60
|
|
||||||
ONE_DAY = 24*ONE_HOUR
|
|
||||||
|
|
||||||
INVALID_DOMAINS = ['youtube.com', 'bloomberg.com', 'wsj.com']
|
INVALID_DOMAINS = ['youtube.com', 'bloomberg.com', 'wsj.com']
|
||||||
MAX_AGE_IN_DAYS = 3*ONE_DAY
|
|
||||||
|
|
||||||
substacks = {}
|
substacks = {}
|
||||||
for key, value in settings.SUBSTACK.items():
|
for key, value in settings.SUBSTACK.items():
|
||||||
|
@ -128,7 +124,7 @@ def update_story(story, is_manual=False):
|
||||||
logging.info('Story not ready yet')
|
logging.info('Story not ready yet')
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if story['date'] and not is_manual and story['date'] + MAX_AGE_IN_DAYS < time.time():
|
if story['date'] and not is_manual and story['date'] + settings.MAX_STORY_AGE < time.time():
|
||||||
logging.info('Story too old, removing')
|
logging.info('Story too old, removing')
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user