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:
parent
75d3a90e3e
commit
d21fa610ba
|
@ -1,11 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
function de(){
|
||||
dudenURL="https://www.duden.de/rechtschreibung/$1"
|
||||
fileName="$1.temp"
|
||||
wget "$dudenURL" --quiet -O "$fileName"
|
||||
grep -A 1 Wortart "$fileName" | tail -1 | sed 's/.*">//' | sed 's/<.*//'
|
||||
rm "$fileName"
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user