feat: Updated to use search

If one goes directly to the guessed url, it fails sometimes
e.g., with Boot
This commit is contained in:
NunoSempere 2021-09-17 17:46:44 +02:00
parent 75d3a90e3e
commit d21fa610ba

View File

@ -1,11 +1,13 @@
#!/bin/bash #!/bin/bash
function de(){ function de(){
dudenURL="https://www.duden.de/rechtschreibung/$1" fileName="$1.temp"
fileName="$1.temp" dudenURL="https://www.duden.de/suchen/dudenonline/$1"
wget "$dudenURL" --quiet -O "$fileName" wget "$dudenURL" --quiet -O "$fileName"
grep -A 1 Wortart "$fileName" | tail -1 | sed 's/.*">//' | sed 's/<.*//' answer="$(grep "strong" "$fileName" | head -2 | tail -1 | sed -E "s|<(/)?strong>||g" | sed "s|^\s*||g")"
rm "$fileName" 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 de $1