I want to automatically get short links equivalents for things I CloudDeploy
. I'd appreciate some tips on integrating command line workflow below into Mathematica function. For command line, using free API key, I do
To shorten www.google.com
on command line, I execute following:
curl https://www.googleapis.com/urlshortener/v1/url?key=$key \
-H 'Content-Type: application/json' \
-d '{"longUrl": "http://www.google.com/"}'
This will print the following to stdout, thing next to id
contains the shortened URL.
{
"kind": "urlshortener#url",
"id": "https://goao.gl/fbsS",
"longUrl": "http://www.google.com/"
}