Use new fucntion to solve twitter error.

This commit is contained in:
pluja 2020-11-10 12:44:40 +01:00
parent 2b20fa7503
commit 9fb1e5597e

View File

@ -4,6 +4,7 @@ from werkzeug.datastructures import Headers
from concurrent.futures import as_completed
from numerize import numerize
from bs4 import BeautifulSoup
from operator import itemgetter
from re import findall
from nitter import user
import time, datetime
@ -40,7 +41,8 @@ def get_feed(usernames, daysMaxOld=10, includeRT=True):
else:
userFeed+=feed
try:
userFeed.sort(key=lambda x: datetime.datetime.strptime(x['timeStamp'], '%Y-%m-%d %H:%M:%S'), reverse=True)
userFeed = sorted(userFeed, key=itemgetter('timeStamp'), reverse=True)
#userFeed.sort(key=lambda x: datetime.datetime.strptime(x['timeStamp'], '%Y-%m-%d %H:%M:%S'), reverse=True)
except:
return userFeed
return userFeed