aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-03-30 09:34:29 +0200
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-03-30 09:35:11 +0200
commit34c9cf55458055c281c9137c591bbfe02dbb64fa (patch)
tree8fd652960e6c09c1202fe011412c5e448acd0c37 /lisp
parent447d49610b8986a3aef763e2ff8566e93110eba7 (diff)
view-trending: add limit params, and go to point min
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mastodon-search.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el
index 3794c4e..abb7995 100644
--- a/lisp/mastodon-search.el
+++ b/lisp/mastodon-search.el
@@ -104,7 +104,11 @@ TYPE is a string, either tags, statuses, or links.
PRINT-FUN is the function used to print the data from the response."
(let* ((url (mastodon-http--api
(format "trends/%s" type)))
- (response (mastodon-http--get-json url))
+ ;; max for statuses = 40, for others = 20
+ (params (if (equal type "statuses")
+ `(("limit" . "40"))
+ `(("limit" . "20")) ))
+ (response (mastodon-http--get-json url params))
(data (cond ((equal type "tags")
(mapcar #'mastodon-search--get-hashtag-info
response))
@@ -127,7 +131,9 @@ PRINT-FUN is the function used to print the data from the response."
(upcase (format " TRENDING %s\n" type))
" " mastodon-tl--horiz-bar "\n\n")
'success))
- (funcall print-fun data)))))
+ (funcall print-fun data)
+ (unless (equal type "statuses")
+ (goto-char (point-min))))))
;; functions for mastodon search