From 730e39858ae03326e576f41e700b53dba832e05d Mon Sep 17 00:00:00 2001 From: danogentili Date: Thu, 28 Apr 2016 22:21:33 +0200 Subject: [PATCH] Fixed rating --- .gitignore | 1 + bash/captionbot.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 91e8d45..9930f68 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ bash/token +*~ diff --git a/bash/captionbot.sh b/bash/captionbot.sh index f54cfd5..d01d758 100755 --- a/bash/captionbot.sh +++ b/bash/captionbot.sh @@ -56,7 +56,7 @@ if [ "$2" != "norate" ];then [ $s -gt 0 -a $s -le 5 ] 2>/dev/null || echo "You didn't input a valid number. Please try again!" done - result=$(curl -s https://www.captionbot.ai/api/message -H "Content-Type: application/json; charset=utf-8" -X POST -d '{"conversationId":'$conversationId', waterMark:'$watermark', "userMessage":"'$s'"}' | sed 's/\\"/"/g;s/^"//g;s/"$//g' | ./JSON.sh -s) + result=$(curl -s https://www.captionbot.ai/api/message -H 'Accept: */*'-H 'Referer: https://www.captionbot.ai/' -H 'Content-Type: application/json; charset=utf-8' -X POST -d '{"conversationId":'$conversationId', waterMark:'$watermark', "userMessage":"'$s'"}' | sed 's/\\"/"/g;s/^"//g;s/"$//g' | ./JSON.sh -s) message=$(echo "$result" | sed '/\[".*Message"\]/!d;s/\[".*Message"\]\t//g;s/^"//g;s/"$//g') [ "$message" = "$s" ] && echo "Thanks for leaving your feedback!" || echo "$message"