From 38ebcda76bc0c264f8384f55c5b32bf049b2d6be Mon Sep 17 00:00:00 2001 From: Erin Congden Date: Sun, 2 Apr 2017 20:48:10 -0700 Subject: Added getting a list of favourited toots --- docs/index.rst | 7 +++++++ mastodon/Mastodon.py | 14 +++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index f9915e6..9dc37e5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -247,6 +247,13 @@ muted or blocked by the logged in user. .. automethod:: Mastodon.mutes .. automethod:: Mastodon.blocks +Reading data: Favourites +------------------------ +This function allows you to get information about statuses favourited +by the authenticated user. + +.. authomethod:: Mastodon.favourites + Writing data: Statuses ---------------------- These functions allow you to post statuses to Mastodon and to diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 1c9ca4b..d42c13f 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -348,6 +348,17 @@ class Mastodon: """ return self.__api_request('GET', '/api/v1/blocks') + ### + # Reading data: Favourites + ### + def favourites(self): + """ + Fetch the authenticated user's favourited statuses. + + Returns a list of toot dicts. + """ + return self.__api_request('GET', '/api/v1/favourites') + ### # Writing data: Statuses ### @@ -440,7 +451,8 @@ class Mastodon: return self.__api_request('POST', '/api/v1/statuses/' + str(id) + "/favourite") def status_unfavourite(self, id): - """Favourite a status. + """ + Un-favourite a status. Returns a toot dict with the un-favourited status. """ -- cgit v1.2.3