Last active
January 21, 2019 08:11
-
-
Save adrienjoly/599645a2c66b2a72f76ad94fb38c801b to your computer and use it in GitHub Desktop.
a bash script to generate qr-codes to download an album from bandcamp
This file contains 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
#!/usr/bin/env bash | |
echo "CSV file: $1" | |
NB_CODES=20 | |
URL_PREFIX="https://harissa.bandcamp.com/yum?code=" | |
npm install qrcode | |
mkdir -p qrcodes | |
perl -ne 'print unless 1../^code$/' < "$1" | head -n $NB_CODES | for code in $(cat) ; do | |
echo "-> generate qrcodes/$code.png" | |
node_modules/.bin/qrcode -t png -o qrcodes/$code.png "$URL_PREFIX$code" | |
done | |
rm -rf node_modules |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment