Show a green tick for verified twitter accounts

This commit is contained in:
jesopo 2019-05-22 20:27:13 +01:00
parent 000b264d6d
commit ce37c66e8a

View file

@ -41,6 +41,10 @@ class Module(ModuleManager.BaseModule):
linked_id = tweet["id"] linked_id = tweet["id"]
username = tweet["user"]["screen_name"] username = tweet["user"]["screen_name"]
verified = ""
if tweet["user"]["verified"]:
verified = " %s" % utils.irc.color("", utils.consts.GREEN)
tweet_link = "https://twitter.com/%s/status/%s" % (username, tweet_link = "https://twitter.com/%s/status/%s" % (username,
linked_id) linked_id)
@ -55,12 +59,12 @@ class Module(ModuleManager.BaseModule):
"created_at"]) "created_at"])
original_timestamp = self.make_timestamp(tweet[ original_timestamp = self.make_timestamp(tweet[
"retweeted_status"]["created_at"]) "retweeted_status"]["created_at"])
return "(@%s (%s) retweeted %s (%s)) %s%s" % ( return "(@%s%s (%s) retweeted %s (%s)) %s%s" % (
username, retweet_timestamp, original_username, username, verified, retweet_timestamp, original_username,
original_timestamp, html.unescape(original_text), original_timestamp, html.unescape(original_text),
short_url) short_url)
else: else:
return "(@%s, %s) %s%s" % (username, return "(@%s%s, %s) %s%s" % (username, verified,
self.make_timestamp(tweet["created_at"]), self.make_timestamp(tweet["created_at"]),
html.unescape(tweet["text"]), short_url) html.unescape(tweet["text"]), short_url)