diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/index.rst | 91 |
1 files changed, 54 insertions, 37 deletions
diff --git a/docs/index.rst b/docs/index.rst index cba55f3..bad52d2 100644 --- a/docs/index.rst +++ b/docs/index.rst | |||
@@ -109,24 +109,24 @@ Toot dicts | |||
109 | mastodon.toot("Hello from Python") | 109 | mastodon.toot("Hello from Python") |
110 | # Returns the following dictionary: | 110 | # Returns the following dictionary: |
111 | { | 111 | { |
112 | 'sensitive': Denotes whether media attachments to the toot are marked sensitive | 112 | 'sensitive': # Denotes whether media attachments to the toot are marked sensitive |
113 | 'created_at': Creation time | 113 | 'created_at': # Creation time |
114 | 'mentions': A list of account dicts mentioned in the toot | 114 | 'mentions': # A list of account dicts mentioned in the toot |
115 | 'uri': Descriptor for the toot | 115 | 'uri': # Descriptor for the toot |
116 | EG 'tag:mastodon.social,2016-11-25:objectId=<id>:objectType=Status' | 116 | # EG 'tag:mastodon.social,2016-11-25:objectId=<id>:objectType=Status' |
117 | 'tags': A list of hashtag dicts used in the toot | 117 | 'tags': # A list of hashtag dicts used in the toot |
118 | 'in_reply_to_id': Numerical id of the toot this toot is in response to | 118 | 'in_reply_to_id': # Numerical id of the toot this toot is in response to |
119 | 'media_attachments': list of media dicts of attached files. Only present | 119 | 'media_attachments': # list of media dicts of attached files. Only present |
120 | when there are attached files. | 120 | # when there are attached files. |
121 | 'id': Numerical id of this toot | 121 | 'id': # Numerical id of this toot |
122 | 'reblogs_count': Number of reblogs | 122 | 'reblogs_count': # Number of reblogs |
123 | 'favourites_count': Number of favourites | 123 | 'favourites_count': # Number of favourites |
124 | 'reblog': Denotes whether the toot is a reblog | 124 | 'reblog': # Denotes whether the toot is a reblog |
125 | 'url': URL of the toot | 125 | 'url': # URL of the toot |
126 | 'content': Content of the toot, as HTML: '<p>Hello from Python</p>' | 126 | 'content': # Content of the toot, as HTML: '<p>Hello from Python</p>' |
127 | 'spoiler_text': Warning text that should be displayed before the toot content | 127 | 'spoiler_text': # Warning text that should be displayed before the toot content |
128 | 'favourited': Denotes whether the logged in user has favourited this toot | 128 | 'favourited': # Denotes whether the logged in user has favourited this toot |
129 | 'account': Account dict for the logged in account | 129 | 'account': # Account dict for the logged in account |
130 | } | 130 | } |
131 | 131 | ||
132 | Relationship dicts | 132 | Relationship dicts |
@@ -136,12 +136,12 @@ Relationship dicts | |||
136 | mastodon.account_follow(<numerical id>) | 136 | mastodon.account_follow(<numerical id>) |
137 | # Returns the following dictionary: | 137 | # Returns the following dictionary: |
138 | { | 138 | { |
139 | 'followed_by': Boolean denoting whether they follow you back | 139 | 'followed_by': # Boolean denoting whether they follow you back |
140 | 'following': Boolean denoting whether you follow them | 140 | 'following': # Boolean denoting whether you follow them |
141 | 'id': Numerical id (same one as <numerical id>) | 141 | 'id': # Numerical id (same one as <numerical id>) |
142 | 'blocking': Boolean denoting whether you are blocking them | 142 | 'blocking': # Boolean denoting whether you are blocking them |
143 | 'muting': Boolean denoting whether you are muting them | 143 | 'muting': # Boolean denoting whether you are muting them |
144 | 'requested': Boolean denoting whether you have sent them a follow request | 144 | 'requested': # Boolean denoting whether you have sent them a follow request |
145 | } | 145 | } |
146 | 146 | ||
147 | Notification dicts | 147 | Notification dicts |
@@ -151,11 +151,11 @@ Notification dicts | |||
151 | mastodon.notifications()[0] | 151 | mastodon.notifications()[0] |
152 | # Returns the following dictionary: | 152 | # Returns the following dictionary: |
153 | { | 153 | { |
154 | 'id': id of the notification. | 154 | 'id': # id of the notification. |
155 | 'type': "mention", "reblog", "favourite" or "follow". | 155 | 'type': # "mention", "reblog", "favourite" or "follow". |
156 | 'status': In case of "mention", the mentioning status. | 156 | 'status': # In case of "mention", the mentioning status. |
157 | In case of reblog / favourite, the reblogged / favourited status. | 157 | # In case of reblog / favourite, the reblogged / favourited status. |
158 | 'account': User dict of the user from whom the notification originates. | 158 | 'account': # User dict of the user from whom the notification originates. |
159 | } | 159 | } |
160 | 160 | ||
161 | Context dicts | 161 | Context dicts |
@@ -165,8 +165,8 @@ Context dicts | |||
165 | mastodon.status_context(<numerical id>) | 165 | mastodon.status_context(<numerical id>) |
166 | # Returns the following dictionary: | 166 | # Returns the following dictionary: |
167 | { | 167 | { |
168 | 'descendants': A list of toot dicts | 168 | 'descendants': # A list of toot dicts |
169 | 'ancestors': A list of toot dicts | 169 | 'ancestors': # A list of toot dicts |
170 | } | 170 | } |
171 | 171 | ||
172 | Media dicts | 172 | Media dicts |
@@ -176,10 +176,10 @@ Media dicts | |||
176 | mastodon.media_post("image.jpg", "image/jpeg") | 176 | mastodon.media_post("image.jpg", "image/jpeg") |
177 | # Returns the following dictionary: | 177 | # Returns the following dictionary: |
178 | { | 178 | { |
179 | 'text_url': The display text for the media (what shows up in toots) | 179 | 'text_url': # The display text for the media (what shows up in toots) |
180 | 'preview_url': The URL for the media preview | 180 | 'preview_url': # The URL for the media preview |
181 | 'type': Media type, EG 'image' | 181 | 'type': # Media type, EG 'image' |
182 | 'url': The URL for the media | 182 | 'url': # The URL for the media |
183 | } | 183 | } |
184 | 184 | ||
185 | App registration and user authentication | 185 | App registration and user authentication |
@@ -200,6 +200,7 @@ methods for this are provided. | |||
200 | .. automethod:: Mastodon.create_app | 200 | .. automethod:: Mastodon.create_app |
201 | .. automethod:: Mastodon.__init__ | 201 | .. automethod:: Mastodon.__init__ |
202 | .. automethod:: Mastodon.log_in | 202 | .. automethod:: Mastodon.log_in |
203 | .. automethod:: Mastodon.auth_request_url | ||
203 | 204 | ||
204 | Reading data: Timelines | 205 | Reading data: Timelines |
205 | ----------------------- | 206 | ----------------------- |
@@ -237,9 +238,17 @@ their relationships. | |||
237 | .. automethod:: Mastodon.account_statuses | 238 | .. automethod:: Mastodon.account_statuses |
238 | .. automethod:: Mastodon.account_following | 239 | .. automethod:: Mastodon.account_following |
239 | .. automethod:: Mastodon.account_followers | 240 | .. automethod:: Mastodon.account_followers |
241 | .. automethod:: Mastodon.follows | ||
240 | .. automethod:: Mastodon.account_relationships | 242 | .. automethod:: Mastodon.account_relationships |
241 | .. automethod:: Mastodon.account_search | 243 | .. automethod:: Mastodon.account_search |
242 | 244 | ||
245 | Reading data: Searching | ||
246 | ----------------------- | ||
247 | This function allows you to search for content. | ||
248 | |||
249 | .. automethod:: Mastodon.search | ||
250 | |||
251 | |||
243 | Reading data: Mutes and blocks | 252 | Reading data: Mutes and blocks |
244 | ------------------------------ | 253 | ------------------------------ |
245 | These functions allow you to get information about accounts that are | 254 | These functions allow you to get information about accounts that are |
@@ -253,7 +262,7 @@ Reading data: Favourites | |||
253 | This function allows you to get information about statuses favourited | 262 | This function allows you to get information about statuses favourited |
254 | by the authenticated user. | 263 | by the authenticated user. |
255 | 264 | ||
256 | .. authomethod:: Mastodon.favourites | 265 | .. automethod:: Mastodon.favourites |
257 | 266 | ||
258 | Reading data: Follow requests | 267 | Reading data: Follow requests |
259 | ----------------------------- | 268 | ----------------------------- |
@@ -302,7 +311,15 @@ to attach media to statuses. | |||
302 | 311 | ||
303 | .. automethod:: Mastodon.media_post | 312 | .. automethod:: Mastodon.media_post |
304 | 313 | ||
314 | Streaming | ||
315 | --------- | ||
316 | These functions allow access to the streaming API. | ||
317 | |||
318 | .. automethod:: Mastodon.user_stream | ||
319 | .. automethod:: Mastodon.public_stream | ||
320 | .. automethod:: Mastodon.hashtag_stream | ||
321 | |||
305 | 322 | ||
306 | .. _Mastodon: https://github.com/Gargron/mastodon | 323 | .. _Mastodon: https://github.com/Gargron/mastodon |
307 | .. _Mastodon flagship instance: http://mastodon.social/ | 324 | .. _Mastodon flagship instance: http://mastodon.social/ |
308 | .. _Mastodon api docs: https://github.com/Gargron/mastodon/wiki/API | 325 | .. _Mastodon api docs: https://github.com/Gargron/mastodon/wiki/API \ No newline at end of file |