summaryrefslogtreecommitdiff
path: root/oedquery.sh
diff options
context:
space:
mode:
authorars <asav1410@gmail.com>2020-10-28 19:27:49 +0000
committerars <asav1410@gmail.com>2020-10-28 19:27:49 +0000
commitd31c1a3b3180f37c40585f870e830e3265cd3f1e (patch)
treeed6e338b3e6198694b07e0c6652c9879c5d2757c /oedquery.sh
parent556797400b94070f008ba003419622916ed10bda (diff)
Add check for exceeded API usage quota.
Diffstat (limited to 'oedquery.sh')
-rwxr-xr-xoedquery.sh5
1 files changed, 5 insertions, 0 deletions
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