aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2017-11-29 17:54:27 +0100
committerLorenz Diener <[email protected]>2017-11-29 17:54:27 +0100
commit1c64c39701ccb3e7bd44989ea6e023c012c8db5f (patch)
treecadad07eefe228e862ac6bc4509a1d917ed2b31a
parent961425e2abc91d693004f2c0d073e387de64e58c (diff)
downloadmastodon.py-1c64c39701ccb3e7bd44989ea6e023c012c8db5f.tar.gz
add hashtag leading # detection, closes #105
-rw-r--r--mastodon/Mastodon.py6
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
Powered by cgit v1.2.3 (git 2.41.0)