From d5bb2418a9d0707cca6bb5b31f308db8c3bf5762 Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Thu, 15 Jun 2017 22:32:17 +0200 Subject: More fixes to documentation --- docs/index.rst | 37 ++++++++++++++++++++++++++++++------- mastodon/Mastodon.py | 6 ++++-- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 03f4b29..8766dd8 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -134,6 +134,8 @@ Toot dicts # when there are attached files. 'tags': # A list of hashtag dicts used in the toot 'application': # Application dict for the client used to post the toot + 'language': # The (autodetected or otherwise set server side) language of the toot. + 'muted': # oolean denoting whether the user has muted this status by way of conversation muting. } Relationship dicts @@ -144,11 +146,12 @@ Relationship dicts # Returns the following dictionary: { 'id': # Numerical id (same one as ) - 'following': # Boolean denoting whether you follow them - 'followed_by': # Boolean denoting whether they follow you back - 'blocking': # Boolean denoting whether you are blocking them - 'muting': # Boolean denoting whether you are muting them - 'requested': # Boolean denoting whether you have sent them a follow request + 'following': # Boolean denoting whether the logged-in user follows the specified user + 'followed_by': # Boolean denoting whether the specified user follows the logged-in user + 'blocking': # Boolean denoting whether the logged-in user has blocked the specified user + 'muting': # Boolean denoting whether the logged-in user has muted the specified user + 'requested': # Boolean denoting whether the logged-in user has sent the specified user a follow request + 'domain_blocking': # Boolean denoting whether the logged-in user has blocked the specified users domain } Notification dicts @@ -185,13 +188,22 @@ Media dicts # Returns the following dictionary: { 'id': # The ID of the attachment. - 'type': # Media type, EG 'image' + 'type': # Media type: 'image', 'video' or 'gifv' 'url': # The URL for the image in the local cache 'remote_url': # The remote URL for the media (if the image is from a remote instance) 'preview_url': # The URL for the media preview 'text_url': # The display text for the media (what shows up in toots) + 'meta': # Dictionary of two image metadata dicts (see below), 'original' and 'small' (preview) } - + + # Metadata dicts: + { + 'width': # Width of the image in pixels + 'height': # Height of the image in pixels + 'aspect': # Aspect ratio of the image as a floating point number + 'size': # Textual representation of the image size in pixels, e.g. '800x600' + } + Card dicts ~~~~~~~~~~ .. code-block:: python @@ -202,7 +214,18 @@ Card dicts 'url': # The URL of the card. 'title': # The title of the card. 'description': # The description of the card. + 'type': # Embed type: 'link', 'photo', 'video', or 'rich' 'image': # (optional) The image associated with the card. + + # OEmbed data (all optional): + 'author_name': # Name of the embedded contents author + 'author_url': # URL pointing to the embedded contents author + 'description': # Description of the embedded content + 'width': # Width of the embedded object + 'height': # Height of the embedded object + 'html': # HTML string of the embed + 'provider_name': # Name of the provider from which the embed originates + 'provider_url': # URL pointing to the embeds provider } App registration and user authentication diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 8eed5cd..b57a16b 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -21,7 +21,7 @@ class Mastodon: api wrapper in python. If anything is unclear, check the official API docs at - https://github.com/Gargron/mastodon/wiki/API + https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md """ __DEFAULT_BASE_URL = 'https://mastodon.social' __DEFAULT_TIMEOUT = 300 @@ -283,7 +283,8 @@ class Mastodon: def status_card(self, id): """ - Fetch a card associated with a status. + Fetch a card associated with a status. A card describes an object (such as an + external video or link) embedded into a status. Returns a card dict. """ @@ -482,6 +483,7 @@ class Mastodon: The visibility parameter is a string value and matches the visibility option on the /api/v1/status POST API endpoint. It accepts any of: + 'direct' - post will be visible only to mentioned users 'private' - post will be visible only to followers 'unlisted' - post will be public but not appear on the public timeline 'public' - post will be public -- cgit v1.2.3