Blog

Dynamic QR code for each blog post

by
published on
For those who don't know what a QR reader is
QR Code is a matrix barcode (or two-dimensional code), readable by QR scannersmobile phones with a camera, and smartphones. The code consists of black modules arranged in a square pattern on white background. The information encoded can be text, URL or other data. -Quoted from wikipedia.org
Now as you can see in this site i have added a dynamic QR code on each post. So for each post a dynamic QR code gets generated. Very simple use of third party sites. I did a bit of web search and figured out there are mainly 2 websites which provide QR <Embed> code. I just modified them a bit with javascripts. You can use any one of the two. TO USE:  Just copy-paste any where in your website and it should start working. 1) goqr.me To change the image size just modify the "size=150x150" to what ever equal value you want. Code:  
<script type="text/javascript">
var uri=window.location.href;
document.write("<img src='http://api.qrserver.com/v1/create-qr-code/?data="+encodeURI(uri)+"&size=150x150'/>");
</script>
  2) kaywa.com To change the image size just modify the "s=5" value to what ever you want. Highest is 12. Code:
<script type="text/javascript">
var uri=window.location.href;
document.write("<img src="http://qrcode.kaywa.com/img.php?s=5&d="+encodeURI(uri)+"" alt="qrcode" />");
</script>
NB: The bigger the image better for lower end mobiles because of there lower camera capability.