Parse RSS feeds with Lua
Example of parsing RSS feeds with Lua. Before running the script install:
- feedparser with
luarocks install feedparser
- luasocket with
luarocks install luasocket
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
- Use option key as meta in Alacritty under macOS
- dcss Make DCSS playable on 4k displays
- #cat-v on weechat configuration
- Previews how man page written in Troff will look like
- plan9 Fix bootloader not being written in Plan9
- Extract lines from a file with sed
- vim Personal sane Vim defaults
- plan9 Run 9front in Qemu
- dcss Dungeon Crawl Stone Soup - New player guide
- Edsger W. Dijkstra Manuscripts ebook
- Fix screen tearing on Debian 12 Xorg and i3
- c Embedding resources into binary with C
- Grep to Less that maintain colors
- Online radio streaming with MPV from terminal
- Extending dte editor