Expanded URL are displayed in the view tweet dialogue

This commit is contained in:
Manuel Cortez 2015-08-20 17:57:06 -05:00
parent de7882e4cf
commit 3d3abc90e1

View File

@ -235,6 +235,10 @@ class baseBufferController(bufferController):
uri = tweet["long_uri"] uri = tweet["long_uri"]
try: try:
tweet = self.session.twitter.twitter.show_status(id=tweet_id) 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: except TwythonError as e:
utils.twitter_error(e) utils.twitter_error(e)
return return
@ -246,6 +250,10 @@ class baseBufferController(bufferController):
id = tweets.get_id(l) id = tweets.get_id(l)
try: try:
tweet = self.session.twitter.twitter.show_status(id=id) 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: except TwythonError as e:
utils.twitter_error(e) utils.twitter_error(e)
return return