mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-23 03:38:08 -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"]
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user