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,10 +1,12 @@
|
||||||
#!/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")"
|
||||||
|
attributes="$(grep -A 3 vignette__snippet "$fileName" | head -4 | tail -1 | sed 's/–.*$//g' | sed "s|^\s*||g")"
|
||||||
|
echo "$answer: $attributes"
|
||||||
rm "$fileName"
|
rm "$fileName"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user