Fix some twitter feeds not working.

This commit is contained in:
pluja 2020-11-10 14:34:48 +01:00
parent 85c24975e0
commit b2c3287144
2 changed files with 2 additions and 3 deletions

View File

@ -9,7 +9,7 @@
<i class="share square outline icon"></i> <i class="share square outline icon"></i>
</span></a> </span></a>
</div> </div>
<div class="header" id="author"><a href="{{url_for('u', username=post.op.replace('@',''))}}">{{ post.op }}</a></div> <div class="header" id="author"><a href="{{url_for('/', username=post.op.replace('@',''))}}">{{ post.op }}</a></div>
<div class="meta"> <div class="meta">
<span class="category" id="time"><i class="clock icon"></i> {{post.date}} </span> <span class="category" id="time"><i class="clock icon"></i> {{post.date}} </span>
{% if post.isPinned %} {% if post.isPinned %}

View File

@ -38,13 +38,12 @@ def get_feed(usernames, daysMaxOld=10, includeRT=True):
else: else:
userFeed.append(tweet) userFeed.append(tweet)
else: else:
userFeed.append(feed) userFeed+=feed
try: try:
for uf in userFeed: for uf in userFeed:
if uf == 'emptyFeed': if uf == 'emptyFeed':
userFeed.remove(uf) userFeed.remove(uf)
userFeed.sort(key=lambda item:item['timeStamp'], reverse=True) userFeed.sort(key=lambda item:item['timeStamp'], reverse=True)
#userFeed.sort(key=lambda x: datetime.datetime.strptime(x['timeStamp'], '%Y-%m-%d %H:%M:%S'), reverse=True)
except: except:
return userFeed return userFeed
return userFeed return userFeed