More fixes to documentation

This commit is contained in:
Lorenz Diener 2017-06-15 22:32:17 +02:00
pare 03e19e3655
commit d5bb2418a9
S'han modificat 2 arxius amb 34 adicions i 9 eliminacions

Veure arxiu

@ -134,6 +134,8 @@ Toot dicts
# when there are attached files. # when there are attached files.
'tags': # A list of hashtag dicts used in the toot 'tags': # A list of hashtag dicts used in the toot
'application': # Application dict for the client used to post 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 Relationship dicts
@ -144,11 +146,12 @@ Relationship dicts
# Returns the following dictionary: # Returns the following dictionary:
{ {
'id': # Numerical id (same one as <numerical id>) 'id': # Numerical id (same one as <numerical id>)
'following': # Boolean denoting whether you follow them 'following': # Boolean denoting whether the logged-in user follows the specified user
'followed_by': # Boolean denoting whether they follow you back 'followed_by': # Boolean denoting whether the specified user follows the logged-in user
'blocking': # Boolean denoting whether you are blocking them 'blocking': # Boolean denoting whether the logged-in user has blocked the specified user
'muting': # Boolean denoting whether you are muting them 'muting': # Boolean denoting whether the logged-in user has muted the specified user
'requested': # Boolean denoting whether you have sent them a follow request '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 Notification dicts
@ -185,13 +188,22 @@ Media dicts
# Returns the following dictionary: # Returns the following dictionary:
{ {
'id': # The ID of the attachment. '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 '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) 'remote_url': # The remote URL for the media (if the image is from a remote instance)
'preview_url': # The URL for the media preview 'preview_url': # The URL for the media preview
'text_url': # The display text for the media (what shows up in toots) '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 Card dicts
~~~~~~~~~~ ~~~~~~~~~~
.. code-block:: python .. code-block:: python
@ -202,7 +214,18 @@ Card dicts
'url': # The URL of the card. 'url': # The URL of the card.
'title': # The title of the card. 'title': # The title of the card.
'description': # The description 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. '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 App registration and user authentication

Veure arxiu

@ -21,7 +21,7 @@ class Mastodon:
api wrapper in python. api wrapper in python.
If anything is unclear, check the official API docs at 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_BASE_URL = 'https://mastodon.social'
__DEFAULT_TIMEOUT = 300 __DEFAULT_TIMEOUT = 300
@ -283,7 +283,8 @@ class Mastodon:
def status_card(self, id): 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. Returns a card dict.
""" """
@ -482,6 +483,7 @@ class Mastodon:
The visibility parameter is a string value and matches the visibility The visibility parameter is a string value and matches the visibility
option on the /api/v1/status POST API endpoint. It accepts any of: 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 'private' - post will be visible only to followers
'unlisted' - post will be public but not appear on the public timeline 'unlisted' - post will be public but not appear on the public timeline
'public' - post will be public 'public' - post will be public