Added getting a list of favourited toots

pull/15/head
Erin Congden 2017-04-02 20:48:10 -07:00
rodzic 36781699c1
commit 38ebcda76b
2 zmienionych plików z 20 dodań i 1 usunięć

Wyświetl plik

@ -247,6 +247,13 @@ muted or blocked by the logged in user.
.. automethod:: Mastodon.mutes .. automethod:: Mastodon.mutes
.. automethod:: Mastodon.blocks .. 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 Writing data: Statuses
---------------------- ----------------------
These functions allow you to post statuses to Mastodon and to These functions allow you to post statuses to Mastodon and to

Wyświetl plik

@ -348,6 +348,17 @@ class Mastodon:
""" """
return self.__api_request('GET', '/api/v1/blocks') 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 # Writing data: Statuses
### ###
@ -440,7 +451,8 @@ class Mastodon:
return self.__api_request('POST', '/api/v1/statuses/' + str(id) + "/favourite") return self.__api_request('POST', '/api/v1/statuses/' + str(id) + "/favourite")
def status_unfavourite(self, id): def status_unfavourite(self, id):
"""Favourite a status. """
Un-favourite a status.
Returns a toot dict with the un-favourited status. Returns a toot dict with the un-favourited status.
""" """