Simple bash function for showing reddit headlines
Display headlines from any r/subreddit (default r/bash) and show comments for each one if desired.
reddit
, show last headline from r/bash (default)reddit commandline
, show 1 headline from r/commandlinereddit bash 10
, show 10 from r/bashreddit zsh 7 show
, get 7 headlines from r/zsh, displays comments within fzf preview
curl
gum, fzf, html-xml-utils, bat
If your system has a html-xml-utils version prior to 8.0, then previews will just show author and comments, nor date. That's because hxselect included with package managers is too old and doesn't allow selection of more than 2 html tags. You might want to download and install a newer one from https://www.w3.org/Tools/HTML-XML-utils.
$ reddit | cowsay
_______________________
< set -x is your friend >
-----------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||