improve nnl filter, add check to see if curl is installed

This commit is contained in:
opfez 2021-04-23 12:06:12 +02:00
parent c0e7f7c24d
commit 931b57de7f
1 changed files with 5 additions and 1 deletions

6
nnl
View File

@ -2,6 +2,10 @@
# New Norwegian linter
if [ ! `command -v curl &>/dev/null` ]; then
echo "no curl installation found!" && exit 1
fi
input_file="$(cat $1)"
get_page() {
@ -11,7 +15,7 @@ get_page() {
no_errors=1
for token in $input_file; do
word="$(echo $token | sed 's/\.//g')"
word="$(echo $token | sed 's/[\.\,\;\:\!\?]//g')"
get_page "$word" | grep "class=\"ikkefunnet\"" >/dev/null
status=$?
if [ 0 -eq $status ]; then