Skip to main content

Newsboat is Awesome!!

<time datetime="2022-11-15 07:33:37 &#43;0530 IST">15 November 2022</time><span class="px-2 text-primary-500">&middot;</span><span>579 words</span><span class="px-2 text-primary-500">&middot;</span><span title="Reading time">3 mins</span><span class="px-2 text-primary-500">&middot;</span> <span class="mb-[2px]"> <a href="#/blog/NewsBoat/index.md" class="text-lg hover:text-primary-500" rel="noopener noreferrer" target="_blank" title="Edit content" ><span class="relative inline-block align-text-bottom px-1 icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M490.3 40.4C512.2 62.27 512.2 97.73 490.3 119.6L460.3 149.7L362.3 51.72L392.4 21.66C414.3-.2135 449.7-.2135 471.6 21.66L490.3 40.4zM172.4 241.7L339.7 74.34L437.7 172.3L270.3 339.6C264.2 345.8 256.7 350.4 248.4 353.2L159.6 382.8C150.1 385.6 141.5 383.4 135 376.1C128.6 370.5 126.4 361 129.2 352.4L158.8 263.6C161.6 255.3 166.2 247.8 172.4 241.7V241.7zM192 63.1C209.7 63.1 224 78.33 224 95.1C224 113.7 209.7 127.1 192 127.1H96C78.33 127.1 64 142.3 64 159.1V416C64 433.7 78.33 448 96 448H352C369.7 448 384 433.7 384 416V319.1C384 302.3 398.3 287.1 416 287.1C433.7 287.1 448 302.3 448 319.1V416C448 469 405 512 352 512H96C42.98 512 0 469 0 416V159.1C0 106.1 42.98 63.1 96 63.1H192z"/></svg> </span></a > </span>

What is Newsboat #

I Recently came across a program called newsboat , which is an rss feed reader. For those who do not know, rss feeds are updates posted to any website and you can subscribe to them to know what is up. It also works on reddit sites, and youtube (tho youtube limits to the latest 15 videos upoaded)

This means you can use it as a newreader to keep track of everything you want, right from the command line!!

Getting Started #

  • First, install newsboat, its available as an arch package, but also probably exists on apt.
  • make a new directory in $HOME called .newsboat, and make two new files in it, config and urls
  • The config file contains the config for newsboat (the colors and bindings and macros)
  • The urls file is just a list of urls that you want to subscribe to.

The config file #

By default, the bindings dont allow for vim keys, and also the colors are whack on my terminal. The macros can make your life so much easier, but I haven’t quite figured it out yet.

Example config file: #

# ~/.newsboat/config

# general settings
auto-reload yes
max-items 50

# externel browser
browser "/usr/bin/brave"
macro m set browser "/usr/local/bin/mpv %u"; open-in-browser ; set browser "/usr/local/bin/w3m %u"
macro l set browser "/usr/local/bin/firefox %u"; open-in-browser ; set browser "/usr/local/bin/w3m %u"

# unbind keys
# unbind-key ENTER
unbind-key j
unbind-key k
unbind-key J
unbind-key K

# bind keys - vim style
bind-key j down
bind-key k up
# bind-key j next articlelist
# bind-key k prev articlelist
bind-key J next-feed articlelist
bind-key K prev-feed articlelist
bind-key G end
bind-key g home
bind-key d pagedown
bind-key u pageup
bind-key l open
bind-key h quit
bind-key a toggle-article-read
bind-key n next-unread
bind-key N prev-unread
bind-key D pb-download
bind-key U show-urls
bind-key x pb-delete

color listnormal cyan default
color listfocus black yellow standout bold
color listnormal_unread blue default
color listfocus_unread yellow default bold
color info red black bold
color article white default bold

# Macros
# macro y set browser "mpv %u" ; open-in-browser ; set browser "elinks %u"
macro y set browser "youtube-dl -q -f %u"; open-in-browser ; set browser "elinks %u"

highlight all "---.*---" yellow
highlight feedlist ".*(0/0))" black
highlight article "(^Feed:.*|^Title:.*|^Author:.*)" cyan default bold
highlight article "(^Link:.*|^Date:.*)" default default
highlight article "https?://[^ ]+" green default
highlight article "^(Title):.*$" blue default
highlight article "\\[[0-9][0-9]*\\]" magenta default bold
highlight article "\\[image\\ [0-9]+\\]" green default bold
highlight article "\\[embedded flash: [0-9][0-9]*\\]" green default bold
highlight article ":.*\\(link\\)$" cyan default
highlight article ":.*\\(image\\)$" blue default
highlight article ":.*\\(embedded flash\\)$" magenta default

The urls file #

The urls file just contains all the urls/rss feeds you want to subscribe to.

Example urls file #

--WEBSITES--
https://kshitijaucharmal.github.io/index.xml
https://lukesmith.xyz/index.xml
https://www.reddit.com/r/unixporn/new.rss

--YOUTUBE--
https://www.youtube.com/feeds/videos.xml?channel_id=UCmtyQOKKmrMVaKuRXz02jbQ
https://www.youtube.com/feeds/videos.xml?channel_id=UC0e3QhIYukixgh5VVpKHH9Q

(You can make sections with –SECTION–)

Getting rss feed urls from websites #

Some websites make this very easy, for example, you can add index.xml to the end of my website and add that url to the urls file.

From Youtube #

  • Open the youtube channel you want to subscribe to
  • View Its source (Ctrl+u on brave)
  • Search for channel_id= and the second result will be the url you need

From reddit #

  • Go to the subreddit you want to subscribe to.
  • You can choose the new tab to subscribe to the new posts
  • Then go to the url bar, remove the last / and add .rss to the end.
  • That is the url you need.