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:
|
else:
|
||||||
time_diff = 999
|
time_diff = 999
|
||||||
|
|
||||||
# If cache file is more than 1 minute old
|
# If cache file is older than 30 minute old
|
||||||
if page == 0 and time_diff > 60:
|
if page == 0 and time_diff > 30:
|
||||||
if cache_file:
|
if cache_file:
|
||||||
for f in cache_file:
|
for f in cache_file:
|
||||||
os.remove(f)
|
os.remove(f)
|
||||||
|
@ -39,11 +39,10 @@ def get_feed(usernames, daysMaxOld=10, includeRT=True):
|
|||||||
userFeed.append(tweet)
|
userFeed.append(tweet)
|
||||||
else:
|
else:
|
||||||
userFeed+=feed
|
userFeed+=feed
|
||||||
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)
|
||||||
except:
|
|
||||||
return userFeed
|
|
||||||
return userFeed
|
return userFeed
|
Reference in New Issue
Block a user