Skip to content

Commit 5058031

Browse files
authored
Added get_account_by_id function
1 parent 3a285f7 commit 5058031

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

imgurpython/client.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,18 @@ def get_account(self, username):
184184
account_data['pro_expiration'],
185185
)
186186

187+
def get_account_by_id(self, userid):
188+
account_data = self.make_request('GET', 'account/?account_id=%i' % userid)
189+
190+
return Account(
191+
account_data['id'],
192+
account_data['url'],
193+
account_data['bio'],
194+
account_data['reputation'],
195+
account_data['created'],
196+
account_data['pro_expiration'],
197+
)
198+
187199
def get_gallery_favorites(self, username, page=0):
188200
self.validate_user_context(username)
189201
gallery_favorites = self.make_request('GET', 'account/%s/gallery_favorites/%d' % (username, page))

0 commit comments

Comments
 (0)