aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/index.rst37
-rw-r--r--mastodon/Mastodon.py6
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
134 # when there are attached files. 134 # when there are attached files.
135 'tags': # A list of hashtag dicts used in the toot 135 'tags': # A list of hashtag dicts used in the toot
136 'application': # Application dict for the client used to post the toot 136 'application': # Application dict for the client used to post the toot
137 'language': # The (autodetected or otherwise set server side) language of the toot.
138 'muted': # oolean denoting whether the user has muted this status by way of conversation muting.
137 } 139 }
138 140
139Relationship dicts 141Relationship dicts
@@ -144,11 +146,12 @@ Relationship dicts
144 # Returns the following dictionary: 146 # Returns the following dictionary:
145 { 147 {
146 'id': # Numerical id (same one as <numerical id>) 148 'id': # Numerical id (same one as <numerical id>)
147 'following': # Boolean denoting whether you follow them 149 'following': # Boolean denoting whether the logged-in user follows the specified user
148 'followed_by': # Boolean denoting whether they follow you back 150 'followed_by': # Boolean denoting whether the specified user follows the logged-in user
149 'blocking': # Boolean denoting whether you are blocking them 151 'blocking': # Boolean denoting whether the logged-in user has blocked the specified user
150 'muting': # Boolean denoting whether you are muting them 152 'muting': # Boolean denoting whether the logged-in user has muted the specified user
151 'requested': # Boolean denoting whether you have sent them a follow request 153 'requested': # Boolean denoting whether the logged-in user has sent the specified user a follow request
154 'domain_blocking': # Boolean denoting whether the logged-in user has blocked the specified users domain
152 } 155 }
153 156
154Notification dicts 157Notification dicts
@@ -185,13 +188,22 @@ Media dicts
185 # Returns the following dictionary: 188 # Returns the following dictionary:
186 { 189 {
187 'id': # The ID of the attachment. 190 'id': # The ID of the attachment.
188 'type': # Media type, EG 'image' 191 'type': # Media type: 'image', 'video' or 'gifv'
189 'url': # The URL for the image in the local cache 192 'url': # The URL for the image in the local cache
190 'remote_url': # The remote URL for the media (if the image is from a remote instance) 193 'remote_url': # The remote URL for the media (if the image is from a remote instance)
191 'preview_url': # The URL for the media preview 194 'preview_url': # The URL for the media preview
192 'text_url': # The display text for the media (what shows up in toots) 195 'text_url': # The display text for the media (what shows up in toots)
196 'meta': # Dictionary of two image metadata dicts (see below), 'original' and 'small' (preview)
193 } 197 }
194 198
199 # Metadata dicts:
200 {
201 'width': # Width of the image in pixels
202 'height': # Height of the image in pixels
203 'aspect': # Aspect ratio of the image as a floating point number
204 'size': # Textual representation of the image size in pixels, e.g. '800x600'
205 }
206
195Card dicts 207Card dicts
196~~~~~~~~~~ 208~~~~~~~~~~
197.. code-block:: python 209.. code-block:: python
@@ -202,7 +214,18 @@ Card dicts
202 'url': # The URL of the card. 214 'url': # The URL of the card.
203 'title': # The title of the card. 215 'title': # The title of the card.
204 'description': # The description of the card. 216 'description': # The description of the card.
217 'type': # Embed type: 'link', 'photo', 'video', or 'rich'
205 'image': # (optional) The image associated with the card. 218 'image': # (optional) The image associated with the card.
219
220 # OEmbed data (all optional):
221 'author_name': # Name of the embedded contents author
222 'author_url': # URL pointing to the embedded contents author
223 'description': # Description of the embedded content
224 'width': # Width of the embedded object
225 'height': # Height of the embedded object
226 'html': # HTML string of the embed
227 'provider_name': # Name of the provider from which the embed originates
228 'provider_url': # URL pointing to the embeds provider
206 } 229 }
207 230
208App registration and user authentication 231App 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:
21 api wrapper in python. 21 api wrapper in python.
22 22
23 If anything is unclear, check the official API docs at 23 If anything is unclear, check the official API docs at
24 https://github.com/Gargron/mastodon/wiki/API 24 https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md
25 """ 25 """
26 __DEFAULT_BASE_URL = 'https://mastodon.social' 26 __DEFAULT_BASE_URL = 'https://mastodon.social'
27 __DEFAULT_TIMEOUT = 300 27 __DEFAULT_TIMEOUT = 300
@@ -283,7 +283,8 @@ class Mastodon:
283 283
284 def status_card(self, id): 284 def status_card(self, id):
285 """ 285 """
286 Fetch a card associated with a status. 286 Fetch a card associated with a status. A card describes an object (such as an
287 external video or link) embedded into a status.
287 288
288 Returns a card dict. 289 Returns a card dict.
289 """ 290 """
@@ -482,6 +483,7 @@ class Mastodon:
482 483
483 The visibility parameter is a string value and matches the visibility 484 The visibility parameter is a string value and matches the visibility
484 option on the /api/v1/status POST API endpoint. It accepts any of: 485 option on the /api/v1/status POST API endpoint. It accepts any of:
486 'direct' - post will be visible only to mentioned users
485 'private' - post will be visible only to followers 487 'private' - post will be visible only to followers
486 'unlisted' - post will be public but not appear on the public timeline 488 'unlisted' - post will be public but not appear on the public timeline
487 'public' - post will be public 489 'public' - post will be public
Powered by cgit v1.2.3 (git 2.41.0)