adding a 30 day limit to listing entries for global feels

resolves #11
master
Vincent Zeng 2017-11-25 21:39:58 -05:00
parent 5788068d80
commit 9766ef6605
1 changed files with 9 additions and 1 deletions

View File

@ -41,6 +41,7 @@ import time
import json import json
from email.mime.text import MIMEText; from email.mime.text import MIMEText;
import re import re
import datetime
import inflect import inflect
@ -800,7 +801,14 @@ def view_feed():
for entry in filenames: for entry in filenames:
## hardcoded bs ## hardcoded bs
if core.valid(entry): if core.valid(entry):
if re.search("2017", entry): year = int(entry[0:4])
month = int(entry[4:6])
day = int(entry[6:8])
datecheck = datetime.date(year, month, day)
displayCutoff = datetime.date.today() - datetime.timedelta(days=30)
if datecheck > displayCutoff:
#if re.search("2017", entry):
feedList.append(os.path.join(entryDir, entry)) feedList.append(os.path.join(entryDir, entry))
metas = core.meta(feedList) metas = core.meta(feedList)