From 5058031cd4a7d4c58e4d0c2814ad7a410ac0b239 Mon Sep 17 00:00:00 2001 From: SleepProgger Date: Sat, 9 Jul 2016 02:29:04 +0200 Subject: [PATCH] Added get_account_by_id function --- imgurpython/client.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/imgurpython/client.py b/imgurpython/client.py index 9c41ea6..68761a0 100644 --- a/imgurpython/client.py +++ b/imgurpython/client.py @@ -184,6 +184,18 @@ def get_account(self, username): account_data['pro_expiration'], ) + def get_account_by_id(self, userid): + account_data = self.make_request('GET', 'account/?account_id=%i' % userid) + + return Account( + account_data['id'], + account_data['url'], + account_data['bio'], + account_data['reputation'], + account_data['created'], + account_data['pro_expiration'], + ) + def get_gallery_favorites(self, username, page=0): self.validate_user_context(username) gallery_favorites = self.make_request('GET', 'account/%s/gallery_favorites/%d' % (username, page))