Open lirenyeo opened 2 years ago
I'm also getting this Problems parsing JSON"
error, whether I use python2
or python3
.
Changing the relevant parts to the following fixed it for me:
#
# Escape JSON string
#
function json_escape()
{
echo -n "$1" | python3 -c 'import json,sys; print(json.dumps(sys.stdin.read()))'
}
#
# Get Gist API endpoint from top level API
#
function get_gist_api()
{
# GitHub.com & GitHub Enterprise have different
if [[ "${server}" == 'api.github.com' ]]; then
echo "https://${server}/gists"
else
curl --silent --header "$auth_header" https://$server/api/v3 | python3 -c 'import json,sys; print(json.loads(sys.stdin.read())["gists_url"].split("{")[0])'
fi
}
Error Message:
I'm not sure how does the shim work for Alfred? I have python 2 installed via pyenv:
However the
/usr/bin/python3
executable could be read by the Alfred Workflow, so I tried changing the script topython3
:But I don't think the string can be parsed correctly because I will still get error from gist API: