Skip to content
This repository was archived by the owner on Oct 4, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added get_account_by_id function
  • Loading branch information
SleepProgger authored Jul 9, 2016
commit 5058031cd4a7d4c58e4d0c2814ad7a410ac0b239
12 changes: 12 additions & 0 deletions imgurpython/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down