From e886e81778cd7248c911208f6d8c5ffa772f3746 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 12 Dec 2019 19:24:18 +0000 Subject: [PATCH] Timestamp in tag file --- inbox.py | 3 ++- webinterface.py | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/inbox.py b/inbox.py index 58ef4ecf..e5bb199c 100644 --- a/inbox.py +++ b/inbox.py @@ -87,7 +87,8 @@ def storeHashTags(baseDir: str,nickname: str,postJsonObject: {}) -> None: tagName=tag['name'].replace('#','').strip() tagsFilename=tagsDir+'/'+tagName+'.txt' postUrl=postJsonObject['id'].replace('/activity','').replace('/','#') - tagline=nickname+' '+postUrl+'\n' + daysSinceEpoch=(datetime.datetime.utcnow() - datetime.datetime(1970,1,1)).days + tagline=str(daysSinceEpoch)+' '+nickname+' '+postUrl+'\n' if not os.path.isfile(tagsFilename): tagsFile=open(tagsFilename, "w+") if tagsFile: diff --git a/webinterface.py b/webinterface.py index 1bbc924e..bac4dc2a 100644 --- a/webinterface.py +++ b/webinterface.py @@ -397,8 +397,13 @@ def htmlHashtagSearch(domain: str,port: int, \ index-=1 continue else: - nickname=postId.split(' ')[0] - postId=postId.split(' ')[1] + postFields=postId.split(' ') + if len(postFields)!=3: + index=-1 + continue + postDaysSinceEposh=int(postFields[0]) + nickname=postFields[1] + postId=postFields[2] postFilename=locatePost(baseDir,nickname,domain,postId) if not postFilename: index-=1