Add conditional.

This commit is contained in:
Bill Dengler 2015-06-26 22:38:09 -07:00
parent a3ed2ebef8
commit 4b0f7c4cc8

View File

@ -9,6 +9,7 @@ import output
import languageHandler
import arrow
import logging
import config
from long_tweets import twishort
log = logging.getLogger("compose")
@ -55,7 +56,7 @@ def compose_tweet(tweet, db, relative_times):
for url in range(0, len(urls)):
try: text = text.replace(urls[url], tweet["entities"]["urls"][url]["expanded_url"])
except IndexError: pass
if 'long_uri' in tweet:
if config.app['app-settings']['handle_longtweets'] and 'long_uri' in tweet:
try:
oldtext=text
text=twishort.get_full_text(tweet['long_uri'])