upload pod file
[hband-tools.git] / crawler-bin / debuggex
blob1b6adb0aa53f433889fd649d5bbb462dad986b73
2 set -e
3 set -u
6 baseurl=https://www.debuggex.com
8 regex=$1
9 regexjson=${regex//\\/\\\\}
10 regexjson=${regexjson//\"/\\\"}
13 token=$(
14   curl "$baseurl/api/image" \
15     -sS \
16     -H "Accept: application/json" \
17     -H "Content-Type: application/json;charset=utf-8" \
18     -d "{\"flavor\":\"python\",\"regex\":\"$regexjson\",\"strFlags\":\"\",\"testString\":\"My test data\",\"unitTests\":\"[]\"}" |\
19   grep -Eo 'token("[^"]+){2}' | cut -f3 -d'"'
22 test -n "$token"
23 wget "$baseurl/i/$token.png"