Skip to content

Commit

Permalink
Merge pull request #141 from nostalgebraist/npf_param
Browse files Browse the repository at this point in the history
Recognize `npf` as valid param for /posts/* endpoints
  • Loading branch information
komapa committed Nov 5, 2020
2 parents 22bd83f + 7238b60 commit afe2c4c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pytumblr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def posts(self, blogname, type=None, **kwargs):
url = '/v2/blog/{}/posts'.format(blogname)
else:
url = '/v2/blog/{}/posts/{}'.format(blogname, type)
return self.send_api_request("get", url, kwargs, ['id', 'tag', 'limit', 'offset', 'before', 'reblog_info', 'notes_info', 'filter', 'api_key'], True)
return self.send_api_request("get", url, kwargs, ['id', 'tag', 'limit', 'offset', 'before', 'reblog_info', 'notes_info', 'filter', 'api_key', 'npf'], True)

@validate_blogname
def blog_info(self, blogname):
Expand Down Expand Up @@ -209,7 +209,7 @@ def queue(self, blogname, **kwargs):
:returns: a dict created from the JSON response
"""
url = "/v2/blog/{}/posts/queue".format(blogname)
return self.send_api_request("get", url, kwargs, ['limit', 'offset', 'filter'])
return self.send_api_request("get", url, kwargs, ['limit', 'offset', 'filter', 'npf'])

@validate_blogname
def drafts(self, blogname, **kwargs):
Expand All @@ -220,20 +220,20 @@ def drafts(self, blogname, **kwargs):
:returns: a dict created from the JSON response
"""
url = "/v2/blog/{}/posts/draft".format(blogname)
return self.send_api_request("get", url, kwargs, ['filter'])
return self.send_api_request("get", url, kwargs, ['filter', 'npf'])

@validate_blogname
def submission(self, blogname, **kwargs):
"""
Gets posts that are currently in the blog's queue
Gets posts that are currently in the blog's submission list
:param offset: an int, the post you want to start at, for pagination.
:param filter: the post format that you want returned: HTML, text, raw.
:returns: a dict created from the JSON response
"""
url = "/v2/blog/{}/posts/submission".format(blogname)
return self.send_api_request("get", url, kwargs, ["offset", "filter"])
return self.send_api_request("get", url, kwargs, ['offset', 'filter', 'npf'])

@validate_blogname
def follow(self, blogname):
Expand Down

0 comments on commit afe2c4c

Please sign in to comment.