From f864bea4e501202b16885304ba298a5a9812d0bb Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Mon, 30 Jul 2018 15:35:36 +0200 Subject: Document hashtag history dicts --- docs/index.rst | 15 ++++++++++++++- mastodon/Mastodon.py | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index ae2eedb..c82b691 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -299,8 +299,21 @@ Hashtag dicts { 'name': # Hashtag name (not including the #) 'url': # Hashtag URL (can be remote) + 'history': # List of usage history dicts for up to 7 days. Not present in statuses. } - + +Hashtag usage history dicts +~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. _hashtag usage history dict: + +.. code-block:: python + + { + 'day': # Date of the day this history dict is for + 'uses': # Number of statuses using this hashtag on that day + 'accounts': # Number of accounts using this hashtag in at least one status on that day + } + Emoji dicts ~~~~~~~~~~~ .. _emoji dict: diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index ace52ed..b22128f 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -1894,7 +1894,7 @@ class Mastodon: """ Parse dates in certain known json fields, if possible. """ - known_date_fields = ["created_at", "week"] + known_date_fields = ["created_at", "week", "day"] for k, v in json_object.items(): if k in known_date_fields: try: -- cgit v1.2.3