From 01b4d113bcbacde6f15eb491d5652716780342c7 Mon Sep 17 00:00:00 2001 From: naoya_t Date: Wed, 26 Apr 2017 11:49:56 +0900 Subject: Added remote follow support, resolves issue #40 --- mastodon/Mastodon.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mastodon') diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 08075a7..c69fe9e 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -380,6 +380,15 @@ class Mastodon: """ return self.__api_request('GET', '/api/v1/accounts/' + str(id) + '/followers') + def follows(self, uri): + """ + Follow a remote user by uri (username@domain). + + Returns a user dict. + """ + params = self.__generate_params(locals()) + return self.__api_request('POST', '/api/v1/follows', params) + def account_relationships(self, id): """ Fetch relationships (following, followed_by, blocking) of the logged in user to -- cgit v1.2.3