Parse RSS feeds with Lua

note, May 23, 2023, on Mitja Felicijan's blog

Example of parsing RSS feeds with Lua. Before running the script install:

local http = require("socket.http")
local feedparser = require("feedparser")

local feed_url = "https://mitjafelicijan.com/index.xml"

local response, status, _ = http.request(feed_url)
if status == 200 then
  local parsed = feedparser.parse(response)

  -- Print out feed details.
  print("> Title   ", parsed.feed.title)
  print("> Author  ", parsed.feed.author)
  print("> ID      ", parsed.feed.id)
  print("> Entries ", #parsed.entries)

  for _, item in ipairs(parsed.entries) do
    print("GUID    ", item.guid)
    print("Title   ", item.title)
    print("Link    ", item.link)
    print("Summary ", item.summary)
  end
else
  print("! Request failed. Status:", status)
end

Other notes

DateTitle
Use option key as meta in Alacritty under macOS
Online radio streaming with MPV from terminal
Extending dte editor
Aerial photography of algae spotted on river Sava
Write and read structs to/from files in Cc
Lua performance in different environments
Making cgit look nicer
Uninstall Ollama from a Linux box
Minimal desktop setup with cwm and conky
Push to multiple origins at once in Git
Dungeon Crawl Stone Soup - New player guidedcss
Personal sane Vim defaultsvim
10/GUI 10 Finger Multitouch User Interface
Change permissions of matching files recursively
Mount Plan9 over networkplan9