Merge pull request #21 from modgethanc/date-hacking

adding a 30 day limit to listing entries for global feels.

this resolves #11, but perhaps the 30 day limit should be a globally-configurable variable for future updates.
master
hvincent 2017-11-25 21:40:26 -05:00 committed by GitHub
commit 85354189d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -41,6 +41,7 @@ import time
import json
from email.mime.text import MIMEText;
import re
import datetime
import inflect
@ -800,7 +801,14 @@ def view_feed():
for entry in filenames:
## hardcoded bs
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))
metas = core.meta(feedList)