JavaScript bookmarklet for #CompassBetaTest

Sep 09, 2013 by Tony Chung in Society, Technology

TransLink opened the gates to Beta Testers for the new Compass tap-to-pass system. I am fortunate to be one of 10,000 volunteers chosen to tap a demo Compass card on the way on and off the various modes of transit.

So excited that TransLink sent me my Compass Beta Testing kit!

So excited that TransLink sent me my Compass Beta Testing kit!

One one hand, I am excited to get the chance to try this technology out. On the other hand, I’m surprised to have been selected, because my transit modes are pretty straightforward to get to work:

  • West Coast Express – station to station
  • Canada Line – station to station

Just reverse the order to go home.

However, I asked TransLink before the program began if I could let my friend use the Compass card. He uses completely different transit modes than I do, at all hours of the day and night. TransLink responded (paraphrased), “Why yes! We want to test EVERYTHING.”

Allowing more users of a single Compass card doesn’t affect TransLink any. After all, we still have to pay our standard fare as well as tapping the card. Find out about someone who failed to read the not-so-fine print.

My first feedback

TransLink created a form for Beta Testers to submit feedback. However, the part that really bothers me is that all the contact fields, including the 20-digit Compass card number, need to be filled in before the contact form will submit.

This wouldn’t be an issue if we could register our cards to be issued a profile to hold all our contact information. But when I’ll be sending most of my thoughts while riding the train, it doesn’t make sense to have to type all the information in repeatedly.

Feedback form at: http://compassbetatest.com

My solution

Enter JavaScript to the rescue. I stored a simple bookmarklet in my iPhone browser, that automatically fills in my contact info. After I log into the main feedback site, I run the bookmarklet and my contact info (including my nefarious 20-digit Compass card number) gets filled in.

To use this code for yourself, you will have to copy this code into a text editor and replace the information in {curly braces} with your own. Then save it into the “location” field of a bookmark placeholder in your desktop or mobile browser.

javascript:(function(){d=new%20Date();nag=['{first name}','{last name}','{phone number}','{email address}','{compass card number}','Sep-'+d.getDate()+'-'+d.getFullYear()];document.getElementById('pagerowscolumns_0_bottomcontentmodules_0_field_557E8F5E1C5D4BFFA9828F35CBBFC8FA').value=nag[0];document.getElementById('pagerowscolumns_0_bottomcontentmodules_0_field_AFBF0A02A2B3493690BB341856E0A7EB').value=nag[1];document.getElementById('pagerowscolumns_0_bottomcontentmodules_0_field_A95DDCC788D84C52A5B949650627C0B6').value=nag[2];document.getElementById('pagerowscolumns_0_bottomcontentmodules_0_field_16720B55C07F45F98958B72DEE7F35FD').value=nag[3];document.getElementById('pagerowscolumns_0_bottomcontentmodules_0_field_A1AB8BF83B80494DBFED02E596620C69').value=nag[4];document.getElementById('pagerowscolumns_0_bottomcontentmodules_0_field_A5B2FE56B4404342A10CB5596EE03834').value=nag[5];})();

If you need help installing bookmarklets, click here.