-- Leo's gemini proxy

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

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

FOI News — Less the JavaScript


I want to view the Friends of Israel news feed regularly, but I also block JavaScript, and going to https://www.foi.org/news only gives me a blank page and buckets full of JavaScript I don't want to load.


I started combing through the JavaScript, trying to see if I could make JSON requests directly or something like that, to pull the news entries. But the solution is much simpler, thankfully. It turns out that the actual news entries are available in daily digests, which are available in plain HTML. Each day is available through a URL like so:


FOI news digest for 1/31/24


As you can see, it would not be too difficult to manually adjust the date each day. But of course, why do that, when you can run an Emacs function instead?


(defun open-foi-news-digest (&optional time)
  "Constructs the URL for today's Friends of Israel news digest and submits it to xdg-open."
  (interactive)
  (let ((time (if time time (current-time))))
    (browse-url-xdg-open
     (format-time-string "https://www.foi.org/news/news-digest-%-m-%-d-%y/" time))))

So insert that into your init.el, and then M-x open-foi-news-digest will open today's feed. I use helm, so running that command is only a few keystrokes. But of course you could pick a shorter name or assign a keyboard shortcut.


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 21:44:52 2024