mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-22 19:28:09 -06:00
Code cleanup and a few fixes in streaming API
This commit is contained in:
parent
02538322c6
commit
d9a9adef1f
@ -67,6 +67,11 @@ class timelinesStreamer(TwythonStreamer):
|
|||||||
if data.has_key("retweeted_status"):
|
if data.has_key("retweeted_status"):
|
||||||
if data["retweeted_status"].has_key("extended_tweet"):
|
if data["retweeted_status"].has_key("extended_tweet"):
|
||||||
data["retweeted_status"]["full_text"] = data["retweeted_status"]["extended_tweet"]["full_text"]
|
data["retweeted_status"]["full_text"] = data["retweeted_status"]["extended_tweet"]["full_text"]
|
||||||
data["full_text"] = data["text"]
|
|
||||||
data["retweeted_status"]["entities"] = data["retweeted_status"]["extended_tweet"]["entities"]
|
data["retweeted_status"]["entities"] = data["retweeted_status"]["extended_tweet"]["entities"]
|
||||||
|
data["full_text"] = data["text"]
|
||||||
|
if data.has_key("quoted_status"):
|
||||||
|
if data["quoted_status"].has_key("extended_tweet"):
|
||||||
|
data["quoted_status"]["full_text"] = data["quoted_status"]["extended_tweet"]["full_text"]
|
||||||
|
data["quoted_status"]["entities"] = data["quoted_status"]["extended_tweet"]["entities"]
|
||||||
|
data["full_text"] = data["text"]
|
||||||
self.check_tls(data)
|
self.check_tls(data)
|
||||||
|
@ -137,8 +137,13 @@ class streamer(TwythonStreamer):
|
|||||||
if data.has_key("retweeted_status"):
|
if data.has_key("retweeted_status"):
|
||||||
if data["retweeted_status"].has_key("extended_tweet"):
|
if data["retweeted_status"].has_key("extended_tweet"):
|
||||||
data["retweeted_status"]["full_text"] = data["retweeted_status"]["extended_tweet"]["full_text"]
|
data["retweeted_status"]["full_text"] = data["retweeted_status"]["extended_tweet"]["full_text"]
|
||||||
data["full_text"] = data["text"]
|
|
||||||
data["retweeted_status"]["entities"] = data["retweeted_status"]["extended_tweet"]["entities"]
|
data["retweeted_status"]["entities"] = data["retweeted_status"]["extended_tweet"]["entities"]
|
||||||
|
data["full_text"] = data["text"]
|
||||||
|
if data.has_key("quoted_status"):
|
||||||
|
if data["quoted_status"].has_key("extended_tweet"):
|
||||||
|
data["quoted_status"]["full_text"] = data["quoted_status"]["extended_tweet"]["full_text"]
|
||||||
|
data["quoted_status"]["entities"] = data["quoted_status"]["extended_tweet"]["entities"]
|
||||||
|
data["full_text"] = data["text"]
|
||||||
if data["user"]["id"] in self.muted_users: return
|
if data["user"]["id"] in self.muted_users: return
|
||||||
self.check_mentions(data)
|
self.check_mentions(data)
|
||||||
self.check_send(data)
|
self.check_send(data)
|
||||||
|
@ -123,9 +123,7 @@ def compose_quoted_tweet(quoted_tweet, original_tweet, show_screen_names=False):
|
|||||||
text = "rt @%s: %s" % (quoted_tweet["retweeted_status"]["user"]["screen_name"], text)
|
text = "rt @%s: %s" % (quoted_tweet["retweeted_status"]["user"]["screen_name"], text)
|
||||||
if text[-1] in chars: text=text+"."
|
if text[-1] in chars: text=text+"."
|
||||||
original_user = original_tweet["user"]["screen_name"]
|
original_user = original_tweet["user"]["screen_name"]
|
||||||
if original_tweet.has_key("message"):
|
if original_tweet.has_key("full_text"):
|
||||||
original_text = StripChars(original_tweet["message"])
|
|
||||||
elif original_tweet.has_key("full_text"):
|
|
||||||
original_text = StripChars(original_tweet["full_text"])
|
original_text = StripChars(original_tweet["full_text"])
|
||||||
else:
|
else:
|
||||||
original_text = StripChars(original_tweet["text"])
|
original_text = StripChars(original_tweet["text"])
|
||||||
|
Loading…
Reference in New Issue
Block a user