mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-26 12:53:12 -06:00
Added helper for getting user object by id #232
This commit is contained in:
parent
610f18dcb6
commit
64d843d98a
@ -530,4 +530,12 @@ class Session(object):
|
|||||||
if "@%s" % (i["screen_name"]) not in tweet["message"] and i["screen_name"] != tweet["user"]["screen_name"]:
|
if "@%s" % (i["screen_name"]) not in tweet["message"] and i["screen_name"] != tweet["user"]["screen_name"]:
|
||||||
if tweet.has_key("retweeted_status") and tweet["retweeted_status"]["user"]["screen_name"] == i["screen_name"]:
|
if tweet.has_key("retweeted_status") and tweet["retweeted_status"]["user"]["screen_name"] == i["screen_name"]:
|
||||||
continue
|
continue
|
||||||
return tweet
|
return tweet
|
||||||
|
|
||||||
|
def get_user(self, id):
|
||||||
|
if self.db.has_key("users") == False or self.db["users"].has_key(id) == False:
|
||||||
|
user = self.twitter.twitter.show_user(id=id)
|
||||||
|
self.db["users"][user["id"]] = user
|
||||||
|
return user
|
||||||
|
else:
|
||||||
|
return self.db["users"][id]
|
Loading…
Reference in New Issue
Block a user