Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page number parameter for get_subreddit_gallery #42

Open
alexwohlbruck opened this issue Apr 27, 2019 · 0 comments
Open

Page number parameter for get_subreddit_gallery #42

alexwohlbruck opened this issue Apr 27, 2019 · 0 comments

Comments

@alexwohlbruck
Copy link

alexwohlbruck commented Apr 27, 2019

In Imgur's documentation, you are able to specify the an integer that represents the number of the paginated gallery. PyImgur does not offer an argument for the page number, and I'm in need of this functionality at the moment.

https://api.imgur.com/endpoints/gallery#subreddit

Perhaps update the function like so:

def get_subreddit_gallery(self, subreddit, sort='time', window='top',
                            limit=None, page=0):
    """
    Return a list of gallery albums/images submitted to a subreddit.
    A subreddit is a subsection of the website www.reddit.com, where users
    can, among other things, post images.
    :param subreddit: A valid subreddit name.
    :param sort: time | top - defaults to top.
    :param window: Change the date range of the request if the section is
        "top", day | week | month | year | all, defaults to day.
    :param limit: The number of items to return.
    :param page: The page number of the gallery
    """
    url = (self._base_url + "/3/gallery/r/{0}/{1}/{2}/{3}".format(
            subreddit, sort, window, page))
    resp = self._send_request(url, limit=limit)
    return [_get_album_or_image(thing, self) for thing in resp]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant