mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-22 19:28:09 -06:00
Expanded URL are displayed in the view tweet dialogue
This commit is contained in:
parent
de7882e4cf
commit
3d3abc90e1
@ -235,6 +235,10 @@ class baseBufferController(bufferController):
|
||||
uri = tweet["long_uri"]
|
||||
try:
|
||||
tweet = self.session.twitter.twitter.show_status(id=tweet_id)
|
||||
urls = utils.find_urls_in_text(tweet["text"])
|
||||
for url in range(0, len(urls)):
|
||||
try: tweet["text"] = tweet["text"].replace(urls[url], tweet["entities"]["urls"][url]["expanded_url"])
|
||||
except IndexError: pass
|
||||
except TwythonError as e:
|
||||
utils.twitter_error(e)
|
||||
return
|
||||
@ -246,6 +250,10 @@ class baseBufferController(bufferController):
|
||||
id = tweets.get_id(l)
|
||||
try:
|
||||
tweet = self.session.twitter.twitter.show_status(id=id)
|
||||
urls = utils.find_urls_in_text(tweet["text"])
|
||||
for url in range(0, len(urls)):
|
||||
try: tweet["text"] = tweet["text"].replace(urls[url], tweet["entities"]["urls"][url]["expanded_url"])
|
||||
except IndexError: pass
|
||||
except TwythonError as e:
|
||||
utils.twitter_error(e)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user