aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-tl.el
diff options
context:
space:
mode:
authormousebot <mousebot@riseup.net>2022-02-07 19:56:43 +0100
committermousebot <mousebot@riseup.net>2022-02-07 19:56:43 +0100
commitaa6044e06b1a5bb332ac565528adc87bc19c8d42 (patch)
treefc14767b10d25d66d1f47e49b1c02fe9ea57189d /lisp/mastodon-tl.el
parent0a530ebd926fbc5feefc426eda2225a22bef4615 (diff)
create filter first crack
Diffstat (limited to 'lisp/mastodon-tl.el')
-rw-r--r--lisp/mastodon-tl.el18
1 files changed, 18 insertions, 0 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index c110fb2..84df69f 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -993,6 +993,24 @@ webapp"
(mastodon-tl--goto-next-toot)))
(message "No Thread!"))))
+(defun mastodon-tl--create-filter (word contexts)
+ "Create a filter for WORD.
+CONTEXTS must be a list containting at least one of \"home\",
+\"notifications\", \"public\", \"thread\". "
+ (interactive)
+ (let* ((url (mastodon-http--api "filters"))
+ (contexts-processed
+ (mapcar (lambda (x)
+ (cons "context[]" x))
+ contexts))
+ (response
+ (mastodon-http--post url (push
+ `("phrase" . ,word)
+ contexts-processed)
+ nil)))
+ (with-current-buffer response
+ (switch-to-buffer (current-buffer)))))
+
(defun mastodon-tl--get-follow-suggestions ()
"Display a buffer of suggested accounts to follow."
(interactive)