diff options
author | Lorenz Diener <[email protected]> | 2017-11-29 17:54:27 +0100 |
---|---|---|
committer | Lorenz Diener <[email protected]> | 2017-11-29 17:54:27 +0100 |
commit | 1c64c39701ccb3e7bd44989ea6e023c012c8db5f (patch) | |
tree | cadad07eefe228e862ac6bc4509a1d917ed2b31a | |
parent | 961425e2abc91d693004f2c0d073e387de64e58c (diff) | |
download | mastodon.py-1c64c39701ccb3e7bd44989ea6e023c012c8db5f.tar.gz |
add hashtag leading # detection, closes #105
-rw-r--r-- | mastodon/Mastodon.py | 6 |
1 files changed, 5 insertions, 1 deletions
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: | |||
291 | 291 | ||
292 | def timeline_hashtag(self, hashtag, local=False, max_id=None, since_id=None, limit=None): | 292 | def timeline_hashtag(self, hashtag, local=False, max_id=None, since_id=None, limit=None): |
293 | """ | 293 | """ |
294 | Fetch a timeline of toots with a given hashtag. | 294 | Fetch a timeline of toots with a given hashtag. The hashtag parameter |
295 | should not contain the leading #. | ||
295 | 296 | ||
296 | Set "local" to True to retrieve only instance-local tagged posts. | 297 | Set "local" to True to retrieve only instance-local tagged posts. |
297 | 298 | ||
298 | Returns a list of toot dicts. | 299 | Returns a list of toot dicts. |
299 | """ | 300 | """ |
301 | if hashtag.startswith("#"): | ||
302 | throw MastodonIllegalArgumentError("Hashtag parameter should omit leading #") | ||
303 | |||
300 | if max_id != None: | 304 | if max_id != None: |
301 | max_id = self.__unpack_id(max_id) | 305 | max_id = self.__unpack_id(max_id) |
302 | 306 | ||