aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mastodon')
-rw-r--r--mastodon/Mastodon.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py
index 3cf889a..e66711b 100644
--- a/mastodon/Mastodon.py
+++ b/mastodon/Mastodon.py
@@ -468,6 +468,18 @@ class Mastodon:
468 return self.__api_request('GET', '/api/v1/follow_requests', params) 468 return self.__api_request('GET', '/api/v1/follow_requests', params)
469 469
470 ### 470 ###
471 # Reading data: Domain blocks
472 ###
473 def domain_blocks(self, max_id = None, since_id = None, limit = None):
474 """
475 Fetch the authenticated user's blocked domain.
476
477 Returns a list of blocked domain URLs.
478 """
479 params = self.__generate_params(locals())
480 return self.__api_request('GET', '/api/v1/domain_blocks', params)
481
482 ###
471 # Writing data: Statuses 483 # Writing data: Statuses
472 ### 484 ###
473 def status_post(self, status, in_reply_to_id = None, media_ids = None, sensitive = False, visibility = '', spoiler_text = None): 485 def status_post(self, status, in_reply_to_id = None, media_ids = None, sensitive = False, visibility = '', spoiler_text = None):
@@ -714,6 +726,23 @@ class Mastodon:
714 return self.__api_request('POST', '/api/v1/media', files = {'file': media_file_description}) 726 return self.__api_request('POST', '/api/v1/media', files = {'file': media_file_description})
715 727
716 ### 728 ###
729 # Writing data: Domain blocks
730 ###
731 def domain_block(self, domain = None):
732 """
733 Add a block for all statuses originating from the specified domain for the logged-in user.
734 """
735 params = self.__generate_params(locals())
736 return self.__api_request('POST', '/api/v1/domain_blocks', params)
737
738 def domain_unblock(self, domain = None):
739 """
740 Remove a domain block for the logged-in user.
741 """
742 params = self.__generate_params(locals())
743 return self.__api_request('DELETE', '/api/v1/domain_blocks', params)
744
745 ###
717 # Streaming 746 # Streaming
718 ### 747 ###
719 def user_stream(self, listener): 748 def user_stream(self, listener):
Powered by cgit v1.2.3 (git 2.41.0)