From 9bace3d0ca99eb71160b20e88a5f4eaf458e6394 Mon Sep 17 00:00:00 2001 From: Asa Venton Date: Mon, 19 Oct 2020 12:55:46 +0100 Subject: remove oedwordday.sh as the functionality is now included in oeddefine.sh. --- oedwordday.sh | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100755 oedwordday.sh (limited to 'oedwordday.sh') diff --git a/oedwordday.sh b/oedwordday.sh deleted file mode 100755 index d54d403..0000000 --- a/oedwordday.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -word=$( curl --silent https://www.lexico.com/ | hxnormalize -x | hxselect -i "a.linkword" | grep -o '>.*<' | sed 's/[><]//g') -appId= -key= -language=en-gb -OPTS='--silent -L -H "app_id: $appId" -H "app_key: $key"' - -entriesUrl=https://od-api.oxforddictionaries.com/api/v2/entries/$language/$word - -# get definition of headword -result=$(eval curl $OPTS $entriesUrl) -ret=$? -if [ "$ret" -ne 0 ] -then - echo "cURL error $ret when fetching." - exit -fi - -# Get first definition from received json -definition=$(echo $result | jq '.results[].lexicalEntries[].entries[0].senses[0].definitions[]') - -# Get lexical category for first definition -lexicalCategory=$(echo $result | jq '.results[].lexicalEntries[0].lexicalCategory.text') - -# Remove surrounding quotes -definition=$(echo "${definition:1: -1}") -lexicalCategory=$(echo "${lexicalCategory:1: -1}") - -# Return word, lexical category and first definition. -echo ${word^}" - "$lexicalCategory" - "$definition -- cgit v1.2.3