Skip to content

Instantly share code, notes, and snippets.

@ziggear
Created May 11, 2013 05:52
Show Gist options
  • Save ziggear/5559036 to your computer and use it in GitHub Desktop.
Save ziggear/5559036 to your computer and use it in GitHub Desktop.
#useage: qrcode yourcontent
#then you will get a qrcode png file which included to your content
function qrcode() {
content=$1
savename=$(date +%Y%m%d)"_"${content:0 :4 }".png"
url="https://chart.googleapis.com/chart?cht=qr&chld=H&chs=200x200&chl="
req=$url$content
curl $req > $savename
if [ $? == 0 ] ; then
echo "saved as "$savename
else
echo "error.curl."$?
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment