Last active
March 6, 2018 04:25
-
-
Save alexjgriffith/3a23ba4899a8f60ffcdf7e9df3419d3b to your computer and use it in GitHub Desktop.
Hacking together bits of mastodon.el to load @Gargron's toots with media
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun lookup-user (user) | |
(let* ((json (mastodon-http--get-json | |
(mastodon-http--api (concat "search?q=" | |
user)))) | |
(accounts (cdr(assoc 'accounts json))) | |
(acct (mapcar (lambda(account) (cdr (assoc 'acct account))) | |
accounts)) | |
(ids (mapcar (lambda(account) (cdr (assoc 'id account))) | |
accounts))) | |
(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") | |
'mastodon-tl--timeline)) | |
(defun user-media-timelines (username) | |
(user-media-timelines-init (cadar (lookup-user username)))) | |
;; set mastodon-instance-url to your instance | |
(let ((mastodon-instance-url "https://cybre.space")) | |
(user-media-timelines "gargron@mastodon.social")) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment