Interact with this post using Mastodon or
rss/atom reader: newsboat
Published on
You’re here and after reading the first two words of this awesome blog you’re now wondering how you may be sure to not miss any crucial news that will be posted. Don’t panic, an RSS/Atom feed reader is the way to go. While there are plenty of options out there, I’ve personally decided to go with newsboat .
What makes it stands out for me:
- Powerful built-in HTML renderer
- Filter articles out based on title, author, contents etc.
- Aggregate articles into meta-feeds by arbitrary criteria
- Macros to execute sequences of actions with just two keystrokes
- Extend functionality with custom scripts
- Apply transformations to feeds before passing them into Newsboat
Let’s talk about some of these features into a little more details:
╭── Aggregate articles into meta-feeds by arbitrary criteria
Listing your news may quickly becomes a gigantic mess if you have no way to sort them. As mentioned earlier, you can do that in newsboat but you can even go deeper by organizing your feeds in categories.
For example, add this code to create a “News” and a “Videos” category and their “News 1”, “News 2”, “Videos 1”, and “Videos 2” subcategories:
News
"query:News 1:tags # \"news1\""
"query:News 2:tags # \"news2\""
Videos
"query:Videos 1:tags # \"videos1\""
"query:Videos 2:tags # \"videos2\""
In newsboat, you will see this tree:
News
News 1
News 2
Videos
Videos 1
Videos 2
To automatically populate these subcategories, simply append your feeds urls with the subcategory name followed by a " !" (yes, there is a space before the exclamation mark). Thus, https://video_channel.com videos1 !
will collect these news in the Videos 1 subcategory.
Note that to collect Youtube’s channels, you will have to use the channel id urls. To convert a user channel to its id there are several online options like this one
╭── Use of scripts
Like (almost) all CLI tools, you can configure your own keybindings for newsboat. But one more time you can do more and use your own scripts. The one I came up with allow me to automatically open a link in a feed with the appropriate application.
Here is my script:
#!/usr/bin/env bash
if echo $1 | grep -E 'jpg|.jpeg|.png'; then
curl $1 --output /tmp/img_newsboat && nomacs /tmp/img_newsboat
elif echo $1 | grep -E 'youtube.com|.mpg$|.mpeg$|.mp4$|.avi$|.mov$'; then
mpv $1
else
librewolf $1
fi
If placed in ~/.config/newsboat/browser
and made executable, add this line in your newsboat config file to automatically call this script:
browser "~/.config/newsboat/browser >/dev/null 2>&1"
This script will automatically detect the link type and use nomacs to open images, mpv to open videos, and librewolf to open urls.
╭── A bonus for the look
You can also customize newsboat interface and here is one trick to make it cleaner by “hidding” the number of news when there’re no new ones. Place this line in your newsboat config file:
highlight feedlist ".*0/0)" default default invis
╭── Side note
Some feeds will provide you with truncated text and you will have to open the url in your web browser to read the entire article. This completely ruins the concept of a rss/atom reader with the sole purpose to have you add a click count to a given website. To force collecting the entire articles from these websites I highly recommend morss which works with most websites.
Thanks for your read. Hope it's been useful to you.
✄ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈
More food for thoughts? Check other posts about: #Cli