-- Leo's gemini proxy

-- Connecting to gem.librehacker.com:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

Emacs: Pull Random Gemini Capsules (publ. 2024-03-22)


Ever since I was censored on Antenna and quit using it, exploring Geminispace for new feeds and capsules has become a lot more difficult. One trick I've used is the feature on Kennedy search engine that displays all known hosts. I will pull the links using gmni, sort them randomly, and then look at the first ten or so. This interactive Emacs function is a wrapper around the shell commands:


(defun random-gemini-capsules (n)
  "Pulls random capsule links from Kennedy search engine and inserts them into a new, unique buffer. Requires gmni, grep, sort, and tail to be installed. User will be prompted for the number of links desired, or a prefix argument may be used."
  (interactive "NCount: ")
  (let ((nbuff (generate-new-buffer "*random-gemini-capsules*")))
    (message "pulling data from gemini://kennedy.gemi.dev, standby...")
    (shell-command
     (concat
      "gmni -L -j always \
gemini://kennedy.gemi.dev/observatory/known-hosts \
| grep '^=>' | sort -R | tail -n "
      (number-to-string n))
     nbuff)))

It takes care of pulling the data, filtering down to N number of random entries, and inserting them into a new temporary buffer. At that point, I will usually use a macro to quickly open each of the links in Lagrange.


The function could be extended to also handle opening the links, say by passing them to browse-url-xdg-open, but I'm not sure how soon I will get around to that.


Copyright


This work © 2024 by Christopher Howard is licensed under Attribution-ShareAlike 4.0 International.


CC BY-SA 4.0 Deed

-- Response ended

-- Page fetched on Tue May 21 12:51:27 2024