Very low TTL for polls that are in progress
This commit is contained in:
parent
409b89d9df
commit
acd24a08c8
@ -322,8 +322,12 @@ def link_to_vnf_from_tweet_data(tweet,video_link):
|
|||||||
for eurl in tweet['entities']['urls']:
|
for eurl in tweet['entities']['urls']:
|
||||||
text = text.replace(eurl["url"],eurl["expanded_url"])
|
text = text.replace(eurl["url"],eurl["expanded_url"])
|
||||||
|
|
||||||
|
ttl = None #default
|
||||||
|
|
||||||
if 'card' in tweet and tweet['card']['name'].startswith('poll'):
|
if 'card' in tweet and tweet['card']['name'].startswith('poll'):
|
||||||
poll=getPollObject(tweet['card'])
|
poll=getPollObject(tweet['card'])
|
||||||
|
if tweet['card']['binding_values']['counts_are_final']['boolean_value'] == False:
|
||||||
|
ttl = datetime.today().replace(microsecond=0) + timedelta(minutes=1)
|
||||||
else:
|
else:
|
||||||
poll=None
|
poll=None
|
||||||
|
|
||||||
@ -343,7 +347,8 @@ def link_to_vnf_from_tweet_data(tweet,video_link):
|
|||||||
nsfw=nsfw,
|
nsfw=nsfw,
|
||||||
verified=tweet['user']['verified'],
|
verified=tweet['user']['verified'],
|
||||||
size=size,
|
size=size,
|
||||||
poll=poll
|
poll=poll,
|
||||||
|
ttl=ttl
|
||||||
)
|
)
|
||||||
|
|
||||||
return vnf
|
return vnf
|
||||||
|
Loading…
x
Reference in New Issue
Block a user