aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2017-06-15 22:48:23 +0200
committerLorenz Diener <[email protected]>2017-06-15 22:48:23 +0200
commitb57b66ebb5dc83b2b1f7c8624d31e605eb6e6c43 (patch)
tree3bd155ed9fa930259a26c03a59316879c9178906
parentd5bb2418a9d0707cca6bb5b31f308db8c3bf5762 (diff)
downloadmastodon.py-b57b66ebb5dc83b2b1f7c8624d31e605eb6e6c43.tar.gz
More doc fixes, instance dictionaries
-rw-r--r--docs/index.rst49
-rw-r--r--mastodon/Mastodon.py6
2 files changed, 33 insertions, 22 deletions
diff --git a/docs/index.rst b/docs/index.rst
index 8766dd8..90cc8e2 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -228,6 +228,20 @@ Card dicts
228 'provider_url': # URL pointing to the embeds provider 228 'provider_url': # URL pointing to the embeds provider
229 } 229 }
230 230
231Instance dicts
232~~~~~~~~~~~~~~
233.. code-block:: python
234
235 mastodon.instance()
236 # Returns the folowing dictionary
237 {
238 'description': # A brief instance description set by the admin
239 'email': # The admin contact e-mail
240 'title': # The instances title
241 'uri': # The instances URL
242 'version': # The instances mastodon version
243 }
244
231App registration and user authentication 245App registration and user authentication
232---------------------------------------- 246----------------------------------------
233Before you can use the mastodon API, you have to register your 247Before you can use the mastodon API, you have to register your
@@ -248,7 +262,7 @@ methods for this are provided.
248.. automethod:: Mastodon.log_in 262.. automethod:: Mastodon.log_in
249.. automethod:: Mastodon.auth_request_url 263.. automethod:: Mastodon.auth_request_url
250 264
251Reading data: Instance 265Reading data: Instances
252----------------------- 266-----------------------
253This function allows you to fetch information associated with the 267This function allows you to fetch information associated with the
254current instance. 268current instance.
@@ -300,9 +314,18 @@ Reading data: Follows
300 314
301.. automethod:: Mastodon.follows 315.. automethod:: Mastodon.follows
302 316
317Reading data: Favourites
318------------------------
319
320.. automethod:: Mastodon.favourites
321
322Reading data: Follow requests
323-----------------------------
324
325.. automethod:: Mastodon.follow_requests
326
303Reading data: Searching 327Reading data: Searching
304----------------------- 328-----------------------
305This function allows you to search for content.
306 329
307.. automethod:: Mastodon.search 330.. automethod:: Mastodon.search
308 331
@@ -317,25 +340,8 @@ muted or blocked by the logged in user.
317 340
318Reading data: Reports 341Reading data: Reports
319------------------------------ 342------------------------------
320These functions allow you to retrieve information about reports filed
321by the authenticated user, and file a report against a user.
322 343
323.. automethod:: Mastodon.reports 344.. automethod:: Mastodon.reports
324.. automethod:: Mastodon.report
325
326Reading data: Favourites
327------------------------
328This function allows you to get information about statuses favourited
329by the authenticated user.
330
331.. automethod:: Mastodon.favourites
332
333Reading data: Follow requests
334-----------------------------
335This function allows you to get a list of pending incoming follow
336requests for the authenticated user.
337
338.. automethod:: Mastodon.follow_requests
339 345
340Writing data: Statuses 346Writing data: Statuses
341---------------------- 347----------------------
@@ -379,6 +385,11 @@ to attach media to statuses.
379 385
380.. automethod:: Mastodon.media_post 386.. automethod:: Mastodon.media_post
381 387
388Writing data: Reports
389---------------------
390
391.. automethod:: Mastodon.report
392
382Streaming 393Streaming
383--------- 394---------
384These functions allow access to the streaming API. 395These functions allow access to the streaming API.
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py
index b57a16b..3cf889a 100644
--- a/mastodon/Mastodon.py
+++ b/mastodon/Mastodon.py
@@ -207,13 +207,13 @@ class Mastodon:
207 return response['access_token'] 207 return response['access_token']
208 208
209 ### 209 ###
210 # Reading data: Instance 210 # Reading data: Instances
211 ### 211 ###
212 def instance(self): 212 def instance(self):
213 """ 213 """
214 Retrieve basic information about the instance, including the URI and administrative contact email. 214 Retrieve basic information about the instance, including the URI and administrative contact email.
215 215
216 Returns a dict. 216 Returns an instance dict.
217 """ 217 """
218 return self.__api_request('GET', '/api/v1/instance/') 218 return self.__api_request('GET', '/api/v1/instance/')
219 219
@@ -656,7 +656,7 @@ class Mastodon:
656 ### 656 ###
657 def report(self, account_id, status_ids, comment): 657 def report(self, account_id, status_ids, comment):
658 """ 658 """
659 Report a user to the admin. 659 Report statuses to the instances administrators.
660 660
661 Accepts a list of toot IDs associated with the report, and a comment. 661 Accepts a list of toot IDs associated with the report, and a comment.
662 662
Powered by cgit v1.2.3 (git 2.41.0)