Wednesday, October 27, 2010

[How to] Show QR codes for links in your web page

QR (Quick Response) code is a two-dimensional bar code consists of black rectangular modules arranged in a square pattern on white background. QR codes can digitally store more data than the standard barcodes. QR code was used for the first time in Japan in 1994 but it became popular only in the last 3-4 years. Thanks to the iPhones and Androids. Almost all the smartphones have QR code readers and the reading of codes takes just few seconds. We may soon see QR Codes storing addresses and URLs appearing in magazines, on signs, buses, business cards, etc. QR codes can be used on your web pages to improve the mobile experience of your users. Making each link on your page available as a QR code will allow the users to quickly navigate to that link on their mobiles.

QR Code QR Code used on Varun's ScratchPad

Steps to be followed to add QR code for the links on your web page:

1. Include the jQuery library (if you have not included already) and jQuery.cluetip plug-in from within the HTML <head> section. Download it from here. [JavaScript experts may want to try this asynchronously loading JavaScripts. Link.]

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js" type="text/javascript"></script>
<script src="jquery.cluetip.js" type="text/javascript"></script>

2. Copy the following HTML snippet and paste it just before closing the </body> tag. The snippet uses Google charts for generating the QR code and the jQuery plug-in cluetip is used for showing the bubble.

<div id="divQR" style="background-color: #D9E6F7; border:4px solid #C1D9FF; text-align:center; display:none;
font-family:calibri;-moz-border-radius: 5px;-webkit-border-radius: 5px;width:200px;height:380px;padding:-5px;">
<img id="imgQR" src="" width="200" height="200" alt="" />
<p align="justify" style="padding-left:15px;padding-right:15px">QR code will be shown for each link on
hovering over it. Scan the QR code above using the Barcode Scanner from your smart phone, and the link
will be instantly accessible on your phone.
</p>
</div>

<script type="text/javascript">
$.fn.cluetip.defaults.dropShadow = false;
$.fn.cluetip.defaults.onActivate = function(e) {
if (e.length > 0) {
var anchor = e.context;
var link = anchor.href;
if (link.indexOf("javascript:") == 0)
return false;

$("#imgQR").attr("src", "http://chart.apis.google.com/chart?chf=a,s,000000&chs=200x200&chld=|2&cht=qr&chl=" + encodeURIComponent(link));
$("#imgQR").attr("alt", anchor.innerText);
return true;
} else
return false;
};
$("a").attr("rel", "#divQR");
$("a.qrLink").cluetip({local: true, hideLocal: true, showTitle: false, clickThrough: true});
</script>

3. Set the attribute class to “qrLink” for all the hyperlinks that you want to show as QR codes.

<a class="qrLink" href="http://blog.varunkumar.me" >Varun's ScratchPad</a>

4. Done. Hover over the hyperlinks to see their QR codes. Scan the codes from your mobile and navigate to the links quickly from your mobile.

Generate QR Code for hyperlinks on all the web pages

If you want to generate QR code for hyperlinks on all the web pages, use this GreaseMonkey script. It works only on Firefox as of now. Download and install GreaseMonkey add-on. Point your browser to this link. Now, the QR code will be shown on hovering over any of the hyperlinks on any web page.

-- Varun

Muffler Mobiles and the Muffler Shops that Made Them

Meineke Muffler Mobile Art CarI run into this muffler art car on Jalopnik last night and where there is one muffler car there is another.This "Muffler mobile" was created by Joe, Scott, and Steve Minghelli, family owners of two Meineke muffler shops in Southern New Jersey. They started out by creating art from used mufflers laying around like muffler men, muffler dogs, muffler waffle irons and

Sunday, October 24, 2010

Google App Scripts for Google Sites

If you are using Google Sites for your Public or Intranet sites, here is an awesome news for you. Google has enabled Google App Scripts for Google Sites. Google App Scripts, which is 1.5 years young can be used to automate business processes that involve multiple applications. This will be very handy if you are running a small business and want to setup the infrastructure needed for your company. You can setup multi-step workflows using the Google App scripts.

Google’s Cloud language

Google App Script, which was originally launched to automate tasks (macros) on Google Docs Spreadsheet, is a server side JavaScript that executes on the Google’s Cloud. Almost all the Google’s services can be accessed using Google App Scripts. Though Google App Scripts are not widely used yet, they have got so much of potential on the Cloud. Some of the popular services of Google App Script includes Calendar, Contacts, Mail, DocsList, Spreadsheet, URLFetch, etc. Google is also experimenting UI services using which you can create applications which interact with the users via rich graphical interfaces. Another interesting addition to the list of services is the JDBC service using which you can write JDBC queries to pull data from any of your data servers. (Supports only MySQL for now). Read more about Google App Scripts here.

Script editor showing a sample functionGoogle App Script for Google Sites

To create a new script, go to More Actions > Manage Site > App Scripts. Click on the Launch Editor option to open the editor where in you can write your scripts. Launch editor will compile and check your script for errors. Once your script is saved successfully, you can add links from your page to trigger these functions. App scripts serve as a perfect back end for all your site operations.

From Google Site, you can add links to trigger the App Script functions

Follow Google App Scripts blog to keep yourself updated on the happenings in the space. If you are new to Google App Scripts, check out this tutorial. I have created a working copy of the same on my sample site.

-- Varun

Friday, October 22, 2010

Google Indic Music Search

Google has made the search more musical when it announced Google Music Search about an year back. But, then, the service was available only in the U.S. Today, Google India has launched a new labs product “Indic Music Search”. It allows you to search for music by artists, albums or songs. Though the description of the Indic Music Search says that only Hindi songs are available, few other regional languages can also be found using this search.

Google MusicGoogle does not host the music files for you. It has partnered with in.com, saavn and saregama to stream the contents to the users. If you are an existing user of any of these services, probably, nothing new for you here. Flash player is needed to play the music straight from your browser.

(Via @Peeyush)

-- Varun

Thursday, October 21, 2010

Google India Engineering Tech Talk series

Google’s Engineering Productivity team is organizing a special event with talks by Google Engineers on October 27th at Google offices in Hyderabad and Bangalore. The theme for the talks will be Engineering at Google. The talks will focus on different phases (Design / Development / Coding / Testing and Release) of Engineering at Google and how the Engineering Productivity team executes on its mission of accelerating Google Engineering. Time: Wednesday, 27th Oct, 4:30 PM. Limited seats. Register here.

Google India

Talk 1

Web Testing at Google – Infrastructure for the world’s most demanding web developers – by Ted Mao. This talk will focus on the infrastructure Google has built to support web testing and how this infrastructure evolved as the web testing needs increased in scale and complexity.

Talk 2

Leveraging feedback and analysis to improve development process – by Brad Green. Brad will demonstrate two Google products Google Feedback and RoundUp using which they collect the feedback from hundreds of millions of users and identity the focus area after outages.

Talk 3

Tools for Continuous Integration at Global Scale – by Nathan York. This talk covers the key insights and technical design elements that enable us to scale the word’s largest continuously integrated code base to thousands of engineers worldwide.

Talk 4

Testing at Google – Dr. James Whittaker. James will focus on how the testing is done at Google to ensure the quality of the products.

Venue:

  • Google India Pvt Ltd, DivyaShree Omega, Hitech City, Hyderabad.
  • Google India Pvt Ltd, RMZ Infinity – Tower E, Old Madras Road, Bangalore.

More details and registration can be found here. Google's Engineering Productivity team is also hosting an invite-only event called GTAC in Hyderabad on Oct 28th and 29th.

-- Varun

google-site-verification: googlea4d68ed16ed2eea6.html