Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Hacking together bits of mastodon.el to load @Gargron's toots with media
(defun lookup-user (user)
(let* ((json (mastodon-http--get-json
(mastodon-http--api (concat "search?q="
(accounts (cdr(assoc 'accounts json)))
(acct (mapcar (lambda(account) (cdr (assoc 'acct account)))
(ids (mapcar (lambda(account) (cdr (assoc 'id account)))
(cl-mapcar (lambda(a b) (list a b)) acct ids)))
(defun user-media-timelines-init (id)
(mastodon-tl--init "media"
(concat "accounts/" id "/statuses?only_media=true")
(defun user-media-timelines (username)
(user-media-timelines-init (cadar (lookup-user username))))
;; set mastodon-instance-url to your instance
(let ((mastodon-instance-url ""))
(user-media-timelines ""))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment