citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

fuzz-rss (432B)


      1 #!/usr/bin/env bash
      2 set -eou pipefail
      3 
      4 filter=${1:-"cat"}
      5 
      6 res=$(<~/var/rss.tsv eval "$filter" | rss)
      7 link=$(awkp 1 <<<"$res")
      8 typ=$(awkp 2 <<<"$res") 
      9 
     10 opener="open"
     11 
     12 if [[ $typ =~ "@blog" ]]; then
     13 	opener="plainweb"
     14 elif [[ $typ =~ "@pod" ]]; then
     15 	opener="mpv"
     16 elif [[ $typ =~ "@yt" ]]; then
     17 	opener="mpv"
     18 elif [[ $typ =~ "@pdf" ]]; then
     19 	opener="pdfget"
     20 elif [[ $typ =~ "@arxiv" ]]; then
     21 	opener="pdfget"
     22 fi
     23 
     24 echo $opener $link