From d31c1a3b3180f37c40585f870e830e3265cd3f1e Mon Sep 17 00:00:00 2001 From: ars Date: Wed, 28 Oct 2020 19:27:49 +0000 Subject: Add check for exceeded API usage quota. --- oedquery.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/oedquery.sh b/oedquery.sh index 88a4aae..b01b201 100755 --- a/oedquery.sh +++ b/oedquery.sh @@ -23,6 +23,11 @@ _getdata() { lemmasUrl=https://od-api.oxforddictionaries.com/api/v2/lemmas/$language/$word # get lemmas to link an inflected form back to its headword (required to get definition) result=$(eval curl $OPTS $lemmasUrl) + if [[ "$result" == "Authentication failed" ]] + then + echo "Authentication failed, probably exceeded monthly usage." + exit 0 + fi ret=$? if [ "$ret" -ne 0 ] then -- cgit v1.2.3