Created
August 29, 2023 22:32
-
-
Save borwickatuw/7f699ec1be98ec7b38bfdeab19c2871b to your computer and use it in GitHub Desktop.
generate qr codes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| URL=$1 | |
| if [ "x$URL" == "x" ] | |
| then | |
| echo "Run as: $0 url" | |
| exit 1 | |
| fi | |
| SHORT_URL=$(curl -s "http://tinyurl.com/api-create.php?url=$URL") | |
| FILENAME=$(perl -le "\$URL='$URL'; \$URL =~ s|\W+|-|g; \$URL =~ s|-$||g; print qq{\$URL.png}") | |
| qrencode -v3 -S -o $FILENAME $SHORT_URL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment