From 8842e7797a4c1edafadd45231ddea7d436efc5e9 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 3 Sep 2022 12:18:44 +0200 Subject: tl--url-lookup command, FIX #240 --- lisp/mastodon-search.el | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'lisp/mastodon-search.el') diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index 4d1a2d3..c7658ba 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -77,27 +77,6 @@ QUERY is the string to search." (tags (alist-get 'hashtags response))) (mapcar #'mastodon-search--get-hashtag-info tags))) -(defun mastodon-search--url-lookup (&optional query-url) - "Do a WebFinger lookup for QUERY-URL. -If a status or account is found, load it in `mastodon.el', if not, just browse the URL in the normal fashion." - (interactive) - (let* ((query (or query-url (url-get-url-at-point))) - (url (format "%s/api/v2/search" mastodon-instance-url)) - (param (concat "resolve=t")) ; webfinger - (response (mastodon-http--get-search-json url query param))) - (if (equal response '((accounts . #1=[]) (statuses . #1#) (hashtags . #1#))) - ;; no results - ;; browse URL here - () - (let ((statuses (assoc 'statuses response)) - (status-1 (seq-first (cdr statuses))) - (status-1-id (alist-get 'id status-1)) - (accounts (assoc 'accounts response))) - ;; TODO: test for a masto URL first? - (when status-1 - (mastodon-tl--single-toot status-1-id)))))) - - ;; trending tags (defun mastodon-search--trending-tags () -- cgit v1.2.3