dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles # fast
git clone https://src.adamsgaard.dk/dotfiles.git # slow
Log | Files | Refs | README | LICENSE Back to index

news (536B)


      1 #!/bin/sh
      2 
      3 die() {
      4 	printf '%s: error: %s\n' "${0##*/}" "$1" >&2
      5 	exit 1
      6 }
      7 
      8 if command -v hurl >/dev/null 2>&1; then
      9 	downloader=hurl
     10 elif command -v curl >/dev/null 2>&1; then
     11 	downloader="curl -s"
     12 else
     13 	die 'hurl or curl not found'
     14 fi
     15 
     16 if [ $# -eq 0 ] || [ "$1" = "dr" ]; then
     17 	$downloader https://www.dr.dk/nyheder/service/feeds/allenyheder | \
     18 		sfeed | sfeed_curses
     19 elif [ "$1" = "npr" ]; then
     20 	url="https://text.npr.org"
     21 elif [ "$1" = "cnn" ]; then
     22 	url="https://lite.cnn.io/en"
     23 else
     24 	url="$1"
     25 fi
     26 [ -n "$url" ] && w3m "$url" || :