Make html_for_tweet() cope if a tweet has no entities.
I'm not 100% sure if it's possible any more to get tweet data that doesn't include entities. I've a feeling it might be, but can't find an example. However, `html_for_tweet()` currently almost handles a tweet not having entities, except it throws `UnboundLocalError` because the `text` variable is declared in the wrong place. This fixes that.
This commit is contained in:
parent
885051acdc
commit
8d719f3f72
1 changed files with 2 additions and 1 deletions
|
|
@ -544,8 +544,9 @@ class Twython(EndpointsMixin, object):
|
|||
if 'retweeted_status' in tweet:
|
||||
tweet = tweet['retweeted_status']
|
||||
|
||||
text = tweet['text']
|
||||
|
||||
if 'entities' in tweet:
|
||||
text = tweet['text']
|
||||
entities = tweet['entities']
|
||||
|
||||
# Mentions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue