From 1c64c39701ccb3e7bd44989ea6e023c012c8db5f Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Wed, 29 Nov 2017 17:54:27 +0100 Subject: [PATCH] add hashtag leading # detection, closes #105 --- mastodon/Mastodon.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 91e6b11..000eb55 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -291,12 +291,16 @@ class Mastodon: def timeline_hashtag(self, hashtag, local=False, max_id=None, since_id=None, limit=None): """ - Fetch a timeline of toots with a given hashtag. + Fetch a timeline of toots with a given hashtag. The hashtag parameter + should not contain the leading #. Set "local" to True to retrieve only instance-local tagged posts. Returns a list of toot dicts. """ + if hashtag.startswith("#"): + throw MastodonIllegalArgumentError("Hashtag parameter should omit leading #") + if max_id != None: max_id = self.__unpack_id(max_id)