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
- plan9 Install Plan9port on Linux
- vim Personal sane Vim defaults
- c Sending signals to C programs
- Download list of YouTube files
- Write ISO to USB Key
- plan9 Mount Plan9 over network
- Make B/W SVG charts with matplotlib
- plan9 Take a screenshot in Plan9
- Extending dte editor
- plan9 Run 9front in Qemu
- Push to multiple origins at once in Git
- dcss Dungeon Crawl Stone Soup - New player guide
- dcss Sane default for Dungeon Crawl Stone Soup Online edition
- 60's IBM Computers Commercial
- Fix screen tearing on Debian 12 Xorg and i3