aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-inspect.el
diff options
context:
space:
mode:
authormousebot <mousebot@riseup.net>2021-11-06 14:49:00 +0100
committermousebot <mousebot@riseup.net>2021-11-06 14:49:00 +0100
commit7718f0b3126407916447c66ac627114693513b04 (patch)
tree3f42647e1cbdc7e83b2433ddbefaf462f4fc950b /lisp/mastodon-inspect.el
parent7e1fd71a793a8d5844eb332ccc1e54e80ecb5223 (diff)
inspect functions for search.el
Diffstat (limited to 'lisp/mastodon-inspect.el')
-rw-r--r--lisp/mastodon-inspect.el34
1 files changed, 33 insertions, 1 deletions
diff --git a/lisp/mastodon-inspect.el b/lisp/mastodon-inspect.el
index 9559b21..2181ea2 100644
--- a/lisp/mastodon-inspect.el
+++ b/lisp/mastodon-inspect.el
@@ -69,7 +69,7 @@
(defun mastodon-inspect--view-single-toot (toot-id)
"View the toot/status represented by TOOT-ID."
(interactive "s Toot ID: ")
- (let ((buffer (get-buffer-create(concat "*mastodon-status-" toot-id "*"))))
+ (let ((buffer (get-buffer-create (concat "*mastodon-status-" toot-id "*"))))
(with-current-buffer buffer
(let ((toot (mastodon-inspect--download-single-toot toot-id )))
(mastodon-tl--toot toot)
@@ -87,5 +87,37 @@
(concat "*mastodon-status-raw-" toot-id "*")
(mastodon-inspect--download-single-toot toot-id)))
+
+(defvar mastodon-inspect--search-query-accounts-result)
+(defvar mastodon-inspect--single-account-json)
+
+(defvar mastodon-inspect--search-query-full-result)
+(defvar mastodon-inspect--search-result-tags)
+
+(defun mastodon-inspect--get-search-result (query)
+ (interactive)
+ (setq mastodon-inspect--search-query-full-result
+ (append ; convert vector to list
+ (mastodon-http--get-search-json
+ (format "%s/api/v2/search" mastodon-instance-url)
+ query)
+ nil))
+ (setq mastodon-inspect--search-result-tags
+ (append (cdr
+ (caddr mastodon-inspect--search-query-full-result))
+ nil)))
+
+(defun mastodon-inspect--get-search-account (query)
+ (interactive)
+ (setq mastodon-inspect--search-query-accounts-result
+ (append ; convert vector to list
+ (mastodon-http--get-search-json
+ (format "%s/api/v1/accounts/search" mastodon-instance-url)
+ query)
+ nil))
+ (setq mastodon-inspect--single-account-json
+ (car mastodon-inspect--search-query-accounts-result)))
+
+
(provide 'mastodon-inspect)
;;; mastodon-inspect.el ends here