Shorten url using shlink via REST API.
The script uses a shlink instance from shlink.io running on your main domain example.com to shorten urls via the REST API from cli. The script is made for a multi-domain installation with two domains. Read more about using multiple domains with shlink.
curl -O https://raw.githubusercontent.com/gflorian/shlinkify/main/shlink.sh
chmod u+x shlink.sh
You need to change the values for DOMAIN1, DOMAIN2 and APIKEY at the beginning of the script. Read in the manual on how to generate an api key.
You may just run shlink.sh and follow the prompts. The only mandatory input is the 'Lang URL' (long URL). All other inputs can be skipped with return. Tags, if desired, need to be comma separated, as in the web-client. If you don't choose a domain, i.e. by entering 1 or 2, it wil use 1.
When an argument is supplied to shlink.sh it will be treated as the long URL and input for this is skipped. Multiple arguments are treated as multiple long urls.
Explain shlinkinfo.sh
for retrieval of information.