Fixed rating

This commit is contained in:
danogentili 2016-04-28 22:21:33 +02:00
parent e0ede9452a
commit 730e39858a
2 changed files with 2 additions and 1 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
bash/token bash/token
*~

View File

@ -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!" [ $s -gt 0 -a $s -le 5 ] 2>/dev/null || echo "You didn't input a valid number. Please try again!"
done 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=$(echo "$result" | sed '/\[".*Message"\]/!d;s/\[".*Message"\]\t//g;s/^"//g;s/"$//g')
[ "$message" = "$s" ] && echo "Thanks for leaving your feedback!" || echo "$message" [ "$message" = "$s" ] && echo "Thanks for leaving your feedback!" || echo "$message"