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
Grep to Less that maintain colors
Mount Plan9 over networkplan9
Add lazy loading of images in Jekyll posts
Cronjobs on Github with Github Actions
Previews how man page written in Troff will look like
Make DCSS playable on 4k displaysdcss
Dungeon Crawl Stone Soup - New player guidedcss
Cache busting in Hugo
Convert all MKV files into other formats
Extend Lua with custom C functions using Clangc
Install Plan9port on Linuxplan9
Using ffmpeg to combine videos side by side
Run 9front in Qemuplan9
Online radio streaming with MPV from terminal
Set color temperature of displays on i3