diff options
-rw-r--r-- | docs/index.rst | 22 | ||||
-rw-r--r-- | mastodon/Mastodon.py | 2 |
2 files changed, 20 insertions, 4 deletions
diff --git a/docs/index.rst b/docs/index.rst index eb4bd27..d7ade82 100644 --- a/docs/index.rst +++ b/docs/index.rst | |||
@@ -57,6 +57,8 @@ User dicts | |||
57 | ~~~~~~~~~~ | 57 | ~~~~~~~~~~ |
58 | .. code-block:: python | 58 | .. code-block:: python |
59 | 59 | ||
60 | mastodon.account(<numerical id>) | ||
61 | # Returns the following dictionary: | ||
60 | { | 62 | { |
61 | 'display_name': The user's display name | 63 | 'display_name': The user's display name |
62 | 'acct': The user's account name as username@domain (@domain omitted for local users) | 64 | 'acct': The user's account name as username@domain (@domain omitted for local users) |
@@ -100,7 +102,7 @@ Relationship dicts | |||
100 | .. code-block:: python | 102 | .. code-block:: python |
101 | 103 | ||
102 | mastodon.account_follow(<numerical id>) | 104 | mastodon.account_follow(<numerical id>) |
103 | # Returns | 105 | # Returns the following dictionary: |
104 | { | 106 | { |
105 | 'followed_by': Boolean denoting whether they follow you back | 107 | 'followed_by': Boolean denoting whether they follow you back |
106 | 'following': Boolean denoting whether you follow them | 108 | 'following': Boolean denoting whether you follow them |
@@ -108,12 +110,26 @@ Relationship dicts | |||
108 | 'blocking': Boolean denoting whether you are blocking them | 110 | 'blocking': Boolean denoting whether you are blocking them |
109 | } | 111 | } |
110 | 112 | ||
113 | Notification dicts | ||
114 | ~~~~~~~~~~~~~~~~~~ | ||
115 | .. code-block:: python | ||
116 | |||
117 | mastodon.notifications() | ||
118 | # Returns the following dictionary: | ||
119 | { | ||
120 | 'id': id of the notification. | ||
121 | 'type': "mention", "reblog", "favourite" or "follow". | ||
122 | 'status': In case of "mention", the mentioning status. | ||
123 | In case of reblog / favourite, the reblogged / favourited status. | ||
124 | 'account': User dict of the user from whom the notification originates. | ||
125 | } | ||
126 | |||
111 | Context dicts | 127 | Context dicts |
112 | ~~~~~~~~~~~~~ | 128 | ~~~~~~~~~~~~~ |
113 | .. code-block:: python | 129 | .. code-block:: python |
114 | 130 | ||
115 | mastodon.status_context(<numerical id>) | 131 | mastodon.status_context(<numerical id>) |
116 | # Returns | 132 | # Returns the following dictionary: |
117 | { | 133 | { |
118 | 'descendants': A list of toot dicts | 134 | 'descendants': A list of toot dicts |
119 | 'ancestors': A list of toot dicts | 135 | 'ancestors': A list of toot dicts |
@@ -124,7 +140,7 @@ Media dicts | |||
124 | .. code-block:: python | 140 | .. code-block:: python |
125 | 141 | ||
126 | mastodon.media_post("image.jpg", "image/jpeg") | 142 | mastodon.media_post("image.jpg", "image/jpeg") |
127 | # Returns | 143 | # Returns the following dictionary: |
128 | { | 144 | { |
129 | 'text_url': The display text for the media (what shows up in toots) | 145 | 'text_url': The display text for the media (what shows up in toots) |
130 | 'preview_url': The URL for the media preview | 146 | 'preview_url': The URL for the media preview |
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 36f20d2..eb13859 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -209,7 +209,7 @@ class Mastodon: | |||
209 | Fetch notifications (mentions, favourites, reblogs, follows) for the authenticated | 209 | Fetch notifications (mentions, favourites, reblogs, follows) for the authenticated |
210 | user. | 210 | user. |
211 | 211 | ||
212 | Returns: TODO | 212 | Returns a list of notification dicts. |
213 | """ | 213 | """ |
214 | return self.__api_request('GET', '/api/v1/notifications') | 214 | return self.__api_request('GET', '/api/v1/notifications') |
215 | 215 | ||