Changed way of detecting quoted statuses. Parsing improvements in tweet displayer

This commit is contained in:
2016-06-27 09:44:36 -05:00
parent b1cf1c5590
commit da39f40048
5 changed files with 20 additions and 20 deletions

View File

@@ -18,15 +18,10 @@
############################################################
from twitter import utils
def get_id(url):
return url.split("/")[-1]
def is_long(tweet):
long = False
for url in range(0, len(tweet["entities"]["urls"])):
if "twitter.com" in tweet["entities"]["urls"][url]["expanded_url"]:
long = get_id(tweet["entities"]["urls"][url]["expanded_url"])
return long
if tweet.has_key("is_quote_status") and tweet["is_quote_status"] == True:
return tweet["quoted_status_id"]
return False
def clear_url(tweet):
urls = utils.find_urls_in_text(tweet["text"])