From aa6044e06b1a5bb332ac565528adc87bc19c8d42 Mon Sep 17 00:00:00 2001 From: mousebot Date: Mon, 7 Feb 2022 19:56:43 +0100 Subject: create filter first crack --- lisp/mastodon-tl.el | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lisp/mastodon-tl.el') 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) -- cgit v1.2.3