aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-http.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@riseup.net>2024-05-26 16:12:08 +0200
committermarty hiatt <martianhiatus@riseup.net>2024-05-26 16:12:08 +0200
commite2071dc3d2bd5540c25f531988a8dd7e714f63cb (patch)
treef0c7a3cb2728c5f0ec4bcf2db9206ec8db324377 /lisp/mastodon-http.el
parent169e751e3cf6a23bc5f9cef2a23080cd549c3f05 (diff)
view instance desc: use api v2
Diffstat (limited to 'lisp/mastodon-http.el')
-rw-r--r--lisp/mastodon-http.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el
index 49c94a4..7ef6f77 100644
--- a/lisp/mastodon-http.el
+++ b/lisp/mastodon-http.el
@@ -47,10 +47,11 @@
(defconst mastodon-http--timeout 15
"HTTP request timeout, in seconds. Has no effect on Emacs < 26.1.")
-(defun mastodon-http--api (endpoint)
- "Return Mastodon API URL for ENDPOINT."
+(defun mastodon-http--api (endpoint &optional version)
+ "Return Mastodon API URL for ENDPOINT.
+Optionally specify VERSION in format vX."
(concat mastodon-instance-url "/api/"
- mastodon-http--api-version "/" endpoint))
+ (or version mastodon-http--api-version) "/" endpoint))
(defun mastodon-http--api-search ()
"Return Mastodon API url for the /search endpoint (v2)."