diff options
-rw-r--r-- | docs/index.rst | 49 | ||||
-rw-r--r-- | mastodon/Mastodon.py | 6 |
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 | ||
231 | Instance 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 | |||
231 | App registration and user authentication | 245 | App registration and user authentication |
232 | ---------------------------------------- | 246 | ---------------------------------------- |
233 | Before you can use the mastodon API, you have to register your | 247 | Before 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 | ||
251 | Reading data: Instance | 265 | Reading data: Instances |
252 | ----------------------- | 266 | ----------------------- |
253 | This function allows you to fetch information associated with the | 267 | This function allows you to fetch information associated with the |
254 | current instance. | 268 | current instance. |
@@ -300,9 +314,18 @@ Reading data: Follows | |||
300 | 314 | ||
301 | .. automethod:: Mastodon.follows | 315 | .. automethod:: Mastodon.follows |
302 | 316 | ||
317 | Reading data: Favourites | ||
318 | ------------------------ | ||
319 | |||
320 | .. automethod:: Mastodon.favourites | ||
321 | |||
322 | Reading data: Follow requests | ||
323 | ----------------------------- | ||
324 | |||
325 | .. automethod:: Mastodon.follow_requests | ||
326 | |||
303 | Reading data: Searching | 327 | Reading data: Searching |
304 | ----------------------- | 328 | ----------------------- |
305 | This 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 | ||
318 | Reading data: Reports | 341 | Reading data: Reports |
319 | ------------------------------ | 342 | ------------------------------ |
320 | These functions allow you to retrieve information about reports filed | ||
321 | by 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 | |||
326 | Reading data: Favourites | ||
327 | ------------------------ | ||
328 | This function allows you to get information about statuses favourited | ||
329 | by the authenticated user. | ||
330 | |||
331 | .. automethod:: Mastodon.favourites | ||
332 | |||
333 | Reading data: Follow requests | ||
334 | ----------------------------- | ||
335 | This function allows you to get a list of pending incoming follow | ||
336 | requests for the authenticated user. | ||
337 | |||
338 | .. automethod:: Mastodon.follow_requests | ||
339 | 345 | ||
340 | Writing data: Statuses | 346 | Writing 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 | ||
388 | Writing data: Reports | ||
389 | --------------------- | ||
390 | |||
391 | .. automethod:: Mastodon.report | ||
392 | |||
382 | Streaming | 393 | Streaming |
383 | --------- | 394 | --------- |
384 | These functions allow access to the streaming API. | 395 | These 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 | ||