german_pronoun/german_pronoun.sh
NunoSempere d21fa610ba feat: Updated to use search
If one goes directly to the guessed url, it fails sometimes
e.g., with Boot
2021-09-17 17:46:44 +02:00

14 lines
468 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
function de(){
fileName="$1.temp"
dudenURL="https://www.duden.de/suchen/dudenonline/$1"
wget "$dudenURL" --quiet -O "$fileName"
answer="$(grep "strong" "$fileName" | head -2 | tail -1 | sed -E "s|<(/)?strong>||g" | sed "s|^\s*||g")"
attributes="$(grep -A 3 vignette__snippet "$fileName" | head -4 | tail -1 | sed 's/.*$//g' | sed "s|^\s*||g")"
echo "$answer: $attributes"
rm "$fileName"
}
de $1