QR Code Hacks

A lightning talk on QR codes at Access last week reminded me that just prior to the Boston Mashathon I did a nifty mashup using the RSS feed from the Developer Network Application Gallery and the Google Chart API. I wanted to mass generate QR Codes for all the web addresses of the applications in the Application Gallery to put them in attendee's badges at the Boston Mashathon. I found a QR code generate where I could perform this task one by one. However, I wanted something way more efficient since there are now over 60 applications in the gallery. I discovered that the Google Chart API has a way to generate QR codes easily. The next thing I needed was a way to get the URLs for all the applications out of the Application gallery so I could easily loop through it and build QR codes. Drupal has a dead easy way to do this. You just use Views to create an RSS feed that includes all the applications. The feed will have the name of the application as the Title and the url in the Link element. Once I had the feed I could use a PHP script to parse it and build the code on the fly. The result was a tabular web page that listed all the application names and their QR code. Saving the page and all its accompanying files to my hard drive gave me all the QR code images. You can see below that the code for producing the QR codes is pretty simple. I could have also written the PHP to just download the image files using curl to a folder on my hard drive but this approach was simpler and also let me display the codes in a web page to check to make sure they were being properly created. If you want to see the page in action you can check in out at http://www.librarywebchic.net/mashups/QR_code_page.php . Be patient the QR codes take a bit of time to load. This demo shows just how easy it is to use data from an RSS feed to produce QR codes. I can imagine a library potentially sending out a New Books list brochure that uses QR codes to link readers of the brochure back to information about a specific book and allow them to place a hold for that book.
  • Karen Coombs

    Karen Coombs

    Senior Product Analyst