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
@ -531,3 +531,11 @@ class Session(object):
|
||||
if tweet.has_key("retweeted_status") and tweet["retweeted_status"]["user"]["screen_name"] == i["screen_name"]:
|
||||
continue
|
||||
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