From beb877d523383d0adf2314e67c3655c6fbe87a7d Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Fri, 13 Oct 2023 16:01:28 +0200 Subject: add basic limit/offset search params --- lisp/mastodon-search.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lisp/mastodon-search.el') diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index 602df8d..bf0f948 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -146,9 +146,11 @@ PRINT-FUN is the function used to print the data from the response." '("statuses" "accounts" "hashtags")) (defun mastodon-search--search-query (query - &optional type following account-id) + &optional type limit + following account-id offset) "Prompt for a search QUERY and return accounts, statuses, and hashtags. TYPE is a member of `mastodon-search-types'. +LIMIT is a number as string, up to 40, with 40 the default. FOLLOWING means limit to accounts followed, for \"accounts\" type only. A single prefix arg also sets FOLLOWING to true. ACCOUNT-ID means limit search to that account, for \"statuses\" type only." @@ -164,10 +166,14 @@ ACCOUNT-ID means limit search to that account, for \"statuses\" type only." (completing-read "Search type: " mastodon-search-types nil t)))) + (limit (or limit "40")) + (offset (or offset "0")) (buffer (format "*mastodon-search-%s-%s*" type query)) (params (cl-remove nil `(("q" . ,query) ,(when type `("type" . ,type)) + ,(when limit `("limit" . ,limit)) + ,(when offset `("offset" . ,offset)) ,(when following `("following" . ,following)) ,(when account-id `("account_id" . ,account-id))))) (response (mastodon-http--get-json url params)) -- cgit v1.2.3