mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-09-01 20:51:34 +00:00
Add conditional.
This commit is contained in:
@@ -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'])
|
||||||
|
Reference in New Issue
Block a user