This commit is contained in:
Daniil Gentili 2016-06-06 19:59:59 +02:00
commit 15b21481be
3 changed files with 8 additions and 1 deletions

1
.gitignore vendored
View File

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

View File

@ -27,6 +27,12 @@ This script will try to recognize the content of any image you give him using Mi
Usage: ./captionbot.sh file
or
Usage: ./captionbot.sh url
Add the norate parameter to avoid the rating prompt:
Usage: ./captionbot.sh url norate
Add the script parameter to avoid the rating prompt and delete all output apart from the image description:
Usage: ./captionbot.sh url script
```
Here follow the instructions :)

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!"
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"