Created
May 11, 2013 05:52
-
-
Save ziggear/5559036 to your computer and use it in GitHub Desktop.
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
#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