mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-01-19 00:40:42 -06:00
Add conditional.
This commit is contained in:
parent
a3ed2ebef8
commit
4b0f7c4cc8
@ -9,6 +9,7 @@ import output
|
|||||||
import languageHandler
|
import languageHandler
|
||||||
import arrow
|
import arrow
|
||||||
import logging
|
import logging
|
||||||
|
import config
|
||||||
from long_tweets import twishort
|
from long_tweets import twishort
|
||||||
log = logging.getLogger("compose")
|
log = logging.getLogger("compose")
|
||||||
|
|
||||||
@ -55,7 +56,7 @@ def compose_tweet(tweet, db, relative_times):
|
|||||||
for url in range(0, len(urls)):
|
for url in range(0, len(urls)):
|
||||||
try: text = text.replace(urls[url], tweet["entities"]["urls"][url]["expanded_url"])
|
try: text = text.replace(urls[url], tweet["entities"]["urls"][url]["expanded_url"])
|
||||||
except IndexError: pass
|
except IndexError: pass
|
||||||
if 'long_uri' in tweet:
|
if config.app['app-settings']['handle_longtweets'] and 'long_uri' in tweet:
|
||||||
try:
|
try:
|
||||||
oldtext=text
|
oldtext=text
|
||||||
text=twishort.get_full_text(tweet['long_uri'])
|
text=twishort.get_full_text(tweet['long_uri'])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user