~sircmpwn/hnstats

dd48beb9f95bb3966e6618180e6f9c22b09d080b — Drew DeVault 6 years ago 2b01da1
Further clean.py improvements
1 files changed, 3 insertions(+), 1 deletions(-)

M clean.py
M clean.py => clean.py +3 -1
@@ 1,11 1,13 @@
#!/usr/bin/env python3
from datetime import datetime, timedelta
from .update import db, ArticleSample
from update import db, Article, ArticleSample

cutoff = datetime.utcnow() - timedelta(days=15)
_cutoff = datetime.utcnow() - timedelta(days=20)

articles = (Article.query
        .filter(Article.submitted < cutoff)
        .filter(Article.submitted > _cutoff)
        .all())

for article in articles: