diff options
author | Lorenz Diener <[email protected]> | 2018-07-30 16:20:56 +0200 |
---|---|---|
committer | Lorenz Diener <[email protected]> | 2018-07-30 16:20:56 +0200 |
commit | cf2d0ebc8246cea8c5e1dbb48687b625affe53c8 (patch) | |
tree | a61d748e5d1460d9fac07a1e154c6cc79953780e /mastodon | |
parent | 300c2882ae00c9cee857e8fa7cbdaaaa00073818 (diff) | |
download | mastodon.py-cf2d0ebc8246cea8c5e1dbb48687b625affe53c8.tar.gz |
Add follow suggestions
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 58380fd..5e73622 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -833,6 +833,19 @@ class Mastodon: | |||
833 | return self.__api_request('GET', url, params) | 833 | return self.__api_request('GET', url, params) |
834 | 834 | ||
835 | ### | 835 | ### |
836 | # Reading data: Follow suggestions | ||
837 | ### | ||
838 | @api_version("2.4.3", "2.4.3", __DICT_VERSION_ACCOUNT) | ||
839 | def suggestions(self): | ||
840 | """ | ||
841 | Fetch follow suggestions for the logged-in user. | ||
842 | |||
843 | Returns a list of `user dicts`_. | ||
844 | |||
845 | """ | ||
846 | return self.__api_request('GET', '/api/v1/suggestions') | ||
847 | |||
848 | ### | ||
836 | # Reading data: Searching | 849 | # Reading data: Searching |
837 | ### | 850 | ### |
838 | @api_version("1.1.0", "2.1.0", __DICT_VERSION_SEARCHRESULT) | 851 | @api_version("1.1.0", "2.1.0", __DICT_VERSION_SEARCHRESULT) |
@@ -867,8 +880,11 @@ class Mastodon: | |||
867 | """ | 880 | """ |
868 | Fetch trending-hashtag information, if the instance provides such information. | 881 | Fetch trending-hashtag information, if the instance provides such information. |
869 | 882 | ||
883 | Does not require authentication. | ||
884 | |||
870 | Returns a list of `hashtag dicts`_, sorted by the instances trending algorithm, | 885 | Returns a list of `hashtag dicts`_, sorted by the instances trending algorithm, |
871 | descending. | 886 | descending. |
887 | |||
872 | """ | 888 | """ |
873 | return self.__api_request('GET', '/api/v1/trends') | 889 | return self.__api_request('GET', '/api/v1/trends') |
874 | 890 | ||
@@ -1452,6 +1468,19 @@ class Mastodon: | |||
1452 | params = self.__generate_params(params_initial) | 1468 | params = self.__generate_params(params_initial) |
1453 | return self.__api_request('PATCH', '/api/v1/accounts/update_credentials', params, files=files) | 1469 | return self.__api_request('PATCH', '/api/v1/accounts/update_credentials', params, files=files) |
1454 | 1470 | ||
1471 | |||
1472 | ### | ||
1473 | # Writing data: Follow suggestions | ||
1474 | ### | ||
1475 | @api_version("2.4.3", "2.4.3", __DICT_VERSION_ACCOUNT) | ||
1476 | def suggestion_delete(self, account_id): | ||
1477 | """ | ||
1478 | Remove a single user from the follow suggestions. | ||
1479 | """ | ||
1480 | account_id = self.__unpack_id(account_id) | ||
1481 | url = '/api/v1/suggestions/{0}'.format(str(account_id)) | ||
1482 | self.__api_request('DELETE', url) | ||
1483 | |||
1455 | ### | 1484 | ### |
1456 | # Writing data: Lists | 1485 | # Writing data: Lists |
1457 | ### | 1486 | ### |