aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErin Congden <[email protected]>2017-04-02 20:48:10 -0700
committerErin Congden <[email protected]>2017-04-02 21:52:45 -0700
commit38ebcda76bc0c264f8384f55c5b32bf049b2d6be (patch)
treefe89f43f138415a2a64686202f8029f996c00eda
parent36781699c135b3a4cd89973ef2f5079f123a0567 (diff)
downloadmastodon.py-38ebcda76bc0c264f8384f55c5b32bf049b2d6be.tar.gz
Added getting a list of favourited toots
-rw-r--r--docs/index.rst7
-rw-r--r--mastodon/Mastodon.py14
2 files changed, 20 insertions, 1 deletions
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.
247.. automethod:: Mastodon.mutes 247.. automethod:: Mastodon.mutes
248.. automethod:: Mastodon.blocks 248.. automethod:: Mastodon.blocks
249 249
250Reading data: Favourites
251------------------------
252This function allows you to get information about statuses favourited
253by the authenticated user.
254
255.. authomethod:: Mastodon.favourites
256
250Writing data: Statuses 257Writing data: Statuses
251---------------------- 258----------------------
252These functions allow you to post statuses to Mastodon and to 259These 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
@@ -349,6 +349,17 @@ class Mastodon:
349 return self.__api_request('GET', '/api/v1/blocks') 349 return self.__api_request('GET', '/api/v1/blocks')
350 350
351 ### 351 ###
352 # Reading data: Favourites
353 ###
354 def favourites(self):
355 """
356 Fetch the authenticated user's favourited statuses.
357
358 Returns a list of toot dicts.
359 """
360 return self.__api_request('GET', '/api/v1/favourites')
361
362 ###
352 # Writing data: Statuses 363 # Writing data: Statuses
353 ### 364 ###
354 def status_post(self, status, in_reply_to_id = None, media_ids = None, sensitive = False, visibility = '', spoiler_text = None): 365 def status_post(self, status, in_reply_to_id = None, media_ids = None, sensitive = False, visibility = '', spoiler_text = None):
@@ -440,7 +451,8 @@ class Mastodon:
440 return self.__api_request('POST', '/api/v1/statuses/' + str(id) + "/favourite") 451 return self.__api_request('POST', '/api/v1/statuses/' + str(id) + "/favourite")
441 452
442 def status_unfavourite(self, id): 453 def status_unfavourite(self, id):
443 """Favourite a status. 454 """
455 Un-favourite a status.
444 456
445 Returns a toot dict with the un-favourited status. 457 Returns a toot dict with the un-favourited status.
446 """ 458 """
Powered by cgit v1.2.3 (git 2.41.0)