Merge pull request #74 from Brobin/user_profile_page

added user profile page for logged in users
This commit is contained in:
michael-lazar
2015-04-05 12:30:06 -07:00
5 changed files with 30 additions and 3 deletions

View File

@@ -310,6 +310,18 @@ class SubredditContent(BaseContent):
return content
@classmethod
def from_redditor(cls, reddit, loader, order='new'):
submissions = reddit.user.get_submitted(sort=order)
display_name = '/r/me'
content = cls(display_name, submissions, loader)
try:
content.get(0)
except (praw.errors.APIException, requests.HTTPError,
praw.errors.RedirectException):
raise SubredditError(display_name)
return content
def get(self, index, n_cols=70):
"""
Grab the `i`th submission, with the title field formatted to fit inside