Skip to content

Instantly share code, notes, and snippets.

@adrienjoly
Last active January 21, 2019 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrienjoly/599645a2c66b2a72f76ad94fb38c801b to your computer and use it in GitHub Desktop.
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
#!/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