I spotted this poster today, encouraging people to search for the Twitter hashtag “#Transformers”.
Wouldn’t it make sense to use a QR code as well? That way people could quickly scan, and be taken straight to the discussion, rather than have to fire up Twitter and do a manual search.
As it happens, it’s slightly tricky to make a QR code which searches for a Twitter hashtag.
There are two things to note:
- Twitter’s search URLs are annoyingly different from every other search URL on the planet.
- You will need to take care of URL Encoding for special characters.
Building The Search Query
A typical Twitter search URL is
With the query at the end, so a search for “Transformers” would be
Hash symbols (#) need to be URL Encoded. In this case, the hash becomes “%23”
However, there is a “gotcha”. Because of the… special… way Twitter constructs its search URLs, we have to URL Encode the percentage sign! So, the “%” becomes “%25”.
So, our final URL becomes
Finally, if you want to use something like Google Charts to create your QR codes, you’ll need the URL Encode all of the : / # ! and other special characters.
The Final Result
We end up with a QR code which can be scanned to take the user directly to the hashtag they are searching for,