Categories: mastodon

RSS - Atom - Subscribe via email

Collect my recent toots in an Org file so that I can refile them

| emacs, mastodon, org

I want to use my microblog posts on Mastodon as building blocks for longer posts on my blog. Getting them into an Org file makes it easier to link to them or refile them to other parts of my Org files so that I can build up my notes.

(use-package pandoc)
(defun my-mastodon-org-feed-formatter (entry)
  (concat "* " (pandoc-convert-stdio
                (dom-text (dom-by-tag
                             (insert "<item>"
                                     (plist-get entry :item-full-text)
                             (xml-parse-region (point-min) (point-max)))
                "html" "org")
          "\n\n[" (format-time-string (cdr org-time-stamp-formats)
                                      (date-to-time (plist-get entry :pubDate)))
"]\n" (plist-get entry :link)))
(setq org-feed-alist '(("Mastodon" ""
                        "~/sync/orgzly/" "Toots"
                        :formatter my-mastodon-org-feed-formatter)))
(defun my-org-feed-sort (pos entries)
    (goto-char pos)
    (when (looking-at org-complex-heading-regexp)
      (org-sort-entries nil ?T))))
(advice-add #'org-feed-add-items :after #'my-org-feed-sort)

Now I can use org-feed-update-all (C-c C-x g) to pull things into my file.

This is part of my Emacs configuration.

Solving the mastodon.el error mastodon-auth--access-token: invalid

| emacs, mastodon

If you get mastodon-auth--handle-token-response: Mastodon-auth--access-token: invalid_grant: The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client. while trying to set up mastodon.el from MELPA, you might have an outdated version. Try the following steps:

  • M-x package-delete mastodon
  • Restart Emacs
  • M-x package-refresh-contents
  • M-x package-install mastodon

If that doesn't work, try installing it from the Git repository:

Posting this here to make it searchable.

On Mastodon:

| emacs, geek, mastodon

Now that the kiddo's reasonably well-settled into virtual school and EmacsConf is chugging along nicely, I finally have a little time to explore Mastodon, a federated social network that quite a lot of people have been shifting to (and quite a lot of people have been on all along). When e-mailed me about including the new Mastodon instance in Emacs News, I figured I'd set up a profile for myself and have a look around.

I like to keep an eye on posts mentioning Emacs once in a while, which might be a little more complicated than it is on Twitter given the distributed nature of Mastodon. Anyway, if you post something you'd like me to include in Emacs News, please mention me at Thanks!

I've also set up a bot that posts things from It's at .

I tend to scroll through Mastodon on my phone or using mastodon.el, which is really nice for keyboard navigation.

Update 2022-11-14: I think I've set it up so that resolves to my profile at, so you can use either or Useful: and (thanks, !)

See y'all there!