dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

dehet (383B)


      1 #!/bin/sh
      2 # Tells you whether a word in Dutch is "de" or "het". Uses welklidwoord.nl as a
      3 # backend.
      4 checkdeps() {
      5   for com in "$@"; do
      6     command -v "$com" >/dev/null 2>&1 \
      7       || { printf '%s required but not found.\n' "$com" >&2 && exit 1; }
      8   done
      9 }
     10 checkdeps curl pup tr
     11 
     12 curl -sL https://welklidwoord.nl/"$1" \
     13   | pup 'h2.nieuwH2 > span text{}' \
     14   | tr -dC '[[:alpha:]]'