Lev Lazinskiy

Terminal RSS Reader With Nom

| Software | Programming | Web |
terminal from fallout video game

I stumbled across nom today, which is a lightweight TUI application written in go that allows you to read RSS feeds in your terminal.

It seems that every few years I get so tired of the bullshit that I decide to get back into using terminal apps. Working in a terminal allows me to pretend that I live in one of those fallout vaults and keep a diary in the black and green terminal that you find next to the stimpacks and radroaches sometimes. I somehow always find my way back to regular applications for one reason or another, but for now I am going to enjoy the comfort and simplicity of the terminal while it lasts.

Of course, this comfort and simplicity comes at a price. Namely, it is uncomfortable and complicated.

Out of the gate I ran into issues. I am not sure if me and every blog I read is doing it wrong, or if this particular app has its schema messed up, but nom looks for content in an xml field called <encoded> and if it does not find it, then it will fall back and show you a link that you need to open in a browser. A lot of the blogs that I read do not use this field at all and instead put the content of the post in the <description> xml tag.

I patched nom to show me the link and the description instead and things seem to be working how I expect them to now. If you are running into a similar issue you can apply the patch below.

diff --git a/internal/commands/commands.go b/internal/commands/commands.go
index 54af59e..2b5dcaf 100644
--- a/internal/commands/commands.go
+++ b/internal/commands/commands.go
@@ -365,6 +365,8 @@ func glamouriseItem(item store.Item) (string, error) {
 	mdown += "\n"
 	mdown += item.PublishedAt.String()
 	mdown += "\n\n"
+	mdown += item.Link
+	mdown += "\n\n"
 	mdown += htmlToMd(item.Content)

 	out, err := glamour.Render(mdown, "dark")
diff --git a/internal/rss/rss.go b/internal/rss/rss.go
index 1628b27..87cf395 100644
--- a/internal/rss/rss.go
+++ b/internal/rss/rss.go
@@ -65,7 +65,7 @@ func feedToRSS(f config.Feed, feed *gofeed.Feed) RSS {
 		if it.Content == "" {
 			// If there's no content (as is the case for YouTube RSS items), fallback
 			// to the link.
-			ni.Content = it.Link
+			ni.Content = it.Description
 		} else {
 			ni.Content = it.Content
 		}

Articles from blogs I follow around the net

Happy Perfect Date!

via Life Is Such A Sweet Insanity. April 26, 2024

Design Systems Smashing Magazine Discussion, April 2024

I had a fantastic time chatting with a group of design system wizards,  Nathan Curtis and Ben Callahan. Geoff Graham did a great job facilitating the conversation, and we covered a lot of ground!

via Blog – Brad Frost April 25, 2024

Pluralistic: Antitrust is a labor issue (25 Apr 2024)

Today's links Antitrust is a labor issue: Banning noncompetes is huge, but it's not all the FTC is doing! Hey look at this: Delights to delectate. This day in history: 2009, 2014, 2019, 2023 Upcoming appearances: Where to find me. Recent appearanc…

via Pluralistic: Daily links from Cory Doctorow April 25, 2024

Generated by openring