diff options
author | Lorenz Diener <[email protected]> | 2017-06-15 23:13:34 +0200 |
---|---|---|
committer | Lorenz Diener <[email protected]> | 2017-06-15 23:13:34 +0200 |
commit | aa3e678c7b8306f1922a2b6de1198b3e677b8d01 (patch) | |
tree | 18d1a0f58d94b13434c9b3df7a7bf051845e4243 /mastodon | |
parent | b57b66ebb5dc83b2b1f7c8624d31e605eb6e6c43 (diff) | |
download | mastodon.py-aa3e678c7b8306f1922a2b6de1198b3e677b8d01.tar.gz |
Domain blocking + documentation
Diffstat (limited to 'mastodon')
-rw-r--r-- | mastodon/Mastodon.py | 29 |
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): |