Skip to content

Commit

Permalink
Merge pull request #238 from arittner/bookmarks-paging
Browse files Browse the repository at this point in the history
Introduces paging parameters for bookmarks
  • Loading branch information
arittner authored Jun 24, 2022
2 parents 243d7a2 + 3b8a653 commit 002c651
Show file tree
Hide file tree
Showing 4 changed files with 419 additions and 137 deletions.
14 changes: 12 additions & 2 deletions mastodon/Mastodon.py
Original file line number Diff line number Diff line change
Expand Up @@ -1633,13 +1633,23 @@ def markers_get(self, timeline=["home"]):
# Reading data: Bookmarks
###
@api_version("3.1.0", "3.1.0", __DICT_VERSION_STATUS)
def bookmarks(self):
def bookmarks(self, max_id=None, min_id=None, since_id=None, limit=None):
"""
Get a list of statuses bookmarked by the logged-in user.
Returns a list of `toot dicts`_.
"""
return self.__api_request('GET', '/api/v1/bookmarks')
if max_id != None:
max_id = self.__unpack_id(max_id)

if min_id != None:
min_id = self.__unpack_id(min_id)

if since_id != None:
since_id = self.__unpack_id(since_id)

params = self.__generate_params(locals())
return self.__api_request('GET', '/api/v1/bookmarks', params)

###
# Writing data: Statuses
Expand Down
2 changes: 1 addition & 1 deletion tests/README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This test suite uses [VCR.py][] to record requests to Mastodon and replay them i
If you want to add or change tests, you will need a Mastodon development server running on `http://localhost:3000`, with the default `admin` user and default password.
To set this up, follow the development guide and set up the database using "rails db:setup".

It also needs a test OAuth app and an additional test user to be set up by applying the provided `setup.sql` to Mastodon's database:
It also needs a test OAuth app-registriation and an additional test user to be set up by applying the provided `setup.sql` to Mastodon's database:

psql -d mastodon_development < tests/setup.sql

Expand Down
Loading

0 comments on commit 002c651

Please sign in to comment.