Fix t#187 and change cache time limit
This commit is contained in:
parent
e08d8ade7a
commit
46faa07273
@ -97,8 +97,8 @@ def twitter(page=0):
|
||||
else:
|
||||
time_diff = 999
|
||||
|
||||
# If cache file is more than 1 minute old
|
||||
if page == 0 and time_diff > 60:
|
||||
# If cache file is older than 30 minute old
|
||||
if page == 0 and time_diff > 30:
|
||||
if cache_file:
|
||||
for f in cache_file:
|
||||
os.remove(f)
|
||||
|
@ -39,11 +39,10 @@ def get_feed(usernames, daysMaxOld=10, includeRT=True):
|
||||
userFeed.append(tweet)
|
||||
else:
|
||||
userFeed+=feed
|
||||
try:
|
||||
for uf in userFeed:
|
||||
if uf == 'emptyFeed':
|
||||
userFeed.remove(uf)
|
||||
userFeed.sort(key=lambda item:item['timeStamp'], reverse=True)
|
||||
except:
|
||||
return userFeed
|
||||
|
||||
for uf in userFeed:
|
||||
if uf == 'emptyFeed':
|
||||
userFeed.remove(uf)
|
||||
userFeed.sort(key=lambda item:item['timeStamp'], reverse=True)
|
||||
|
||||
return userFeed
|
Reference in New Issue
Block a user