Friday, 31 January 2014

I Sold a Chrome Extension but it was a bad decision then??

hen Google decided the pull the plug on Google Reader, I quickly made the switch to Feedly since it was (and still is) the best alternative to Google’s RSS Reader. The one important piece that Feedly did not offer was a Chrome extension that would let users subscribe to RSS feeds on any web page with a click.
Since the extension was something that I needed for my own workflow, I wrote one (writing a Chrome extension is easy) and also published it to Google Chrome store. The last time I checked my Chrome developer dashboard, the extension had gained 30000+ users on Chrome. [Update: Google has removed the extension from the Chrome store.]

Google Chrome Extensions – The New Business Model

One morning I got an email from someone ( I tried Googling her name but it returned no results ) asking me if I would be interested in selling the Feedly Chrome extension. It was a 4-figure offer for something that had taken an hour to create and I agreed to the deal. I had no clue about the buyer and was also curious to know why would anyone pay this kind of money for such a simple Chrome extension.
The extension was sold, they sent the money via PayPal and I transferred the ownership of the extension to a particular Google Account. It was a smooth transition.
A month later, the new owners of the Feedly extension pushed an update to the Chrome store. No, the update didn’t bring any new features to the table nor contained any bug fixes. Instead, they incorporated advertising into the extension.
These aren’t regular banner ads that you see on web pages, these are invisible ads that work the background and replace links on every website that you visit into affiliate links. In simple English, if the extension is activated in Chrome, it will inject adware into all web pages.
The user ratings of the Chrome extension are headed south.
The user ratings of the Chrome extension are headed south.

Adware Laden Chrome Extensions

No surprises, the ratings of the extension have recently plummeted at the Chrome store but the business model of the buyer is simple – they buy popular add-ons, inject affiliate links and the bulk of users would never notice this since the Chrome browser automatically updates add-ons in the background. And there are no changelogs either.
The extension does offer an option to opt-out of advertising (you are opted-in by default) or you can disable them on your own by blocking the superfish.com and www.superfish.com domains in your hosts file but quietly sneaking ads doesn’t sound like the most ethical way to monetize a product.
It was probably a bad idea to sell the Chrome add-on and am sorry if you were an existing user. Meanwhile, you can switch to the Feedly bookmarklet for the adware-free experience.
Update: The story was picked by several news websites – including BBC, Wall Street Journal, Wired, USA Today and Los Angeles Times – and Google has now removed the extension from the store.

Add Search Shortcuts on your Androids or iPhones

How do you search a popular website, say Twitter or YouTube, on your mobile phone? You would launch the browser, open the corresponding website and then use the search box inside that site. Or you would use the mobile app, if you have installed one.
There’s an alternate way as well. You may consider installing search shortcuts on the home screen of your mobile phone and they will help you perform searches on your favorite website with fewer steps.
Search your favorite websites with fewer steps
Search your favorite websites with a tap
Let’s dive right into an example.
Open the Safari browser on your iPhone (or iPad) and click here to open the search shortcut for Wolfram Alpha. A pop-up dialog will open but since we are installing the shortcut, hit the Cancel button to close that dialog. Now tap the Share icon in Safari and choose “Add to Home Screen” to add that search shortcut to your home screen.
The next time you want to search Wolfram on your phone, tap the Wolfram shortcut available on your home screen, enter the search terms and it will take you directly to the search results on the Wolfram website. That’s just one tap.
You can similarly add search shortcuts on your Android device using the newer version of Chrome browser. Open any of the search shortcuts listed below, “cancel” the pop-up dialog and then choose the “Add to homescreen” option under the main menu to place a shortcut on your homescreen for quick access.

Search Shortcuts for Android and iOS

Here are some ready-to-install search shortcuts for some popular websites that you may add to the homescreen of your Android or iOS device.
  1. Twitter Search
  2. YouTube Search
  3. Google I’m Feeling Lucky
  4. Wolfram Alpha
  5. Google Image Search
  6. Bing Search
  7. Amazon Search
  8. Google+ Search
  9. Wikipedia Search
  10. Facebook Search

Write your own Search Shortcuts

A search shortcut is essentially a little piece of JavaScript, much like a bookmarklet, that accepts input through a pop-up dialog and redirects the user to the search results page.
Writing one is easy. For instance, here’s the code for the Google I’m Feeling Lucky shortcut that automatically transports you to the first search result (useful when you don’t remember the exact URL of a site).
  1. <!-- Page Title -->
  2. <title>Feeling Lucky</title>
  3.  
  4. <!-- Touch Icon - This will show up on the home screen -->
  5. <link rel="apple-touch-icon" href="lucky.png" />
  6.  
  7. <script>
  8. var u = "http://www.google.com/";
  9. <!-- Show the input dialog -->
  10. var q = window.prompt('What are you looking for?','');
  11. if(q) {
  12. /* If the user has entered input, redirect to search results */
  13. u = u + "/search?&btnI=I%27m+Feeling+Lucky&q=" + escape(q);
  14. window.location.href = u;
  15. } else {
  16. /* If the user hits cancel, show helper text and do nothing */
  17. document.write("Add me to your home screen");
  18. }
  19. </script>
All you need to know is the URL of the search results page and use it in line #13..

Useful Regular Expressions for your Google Forms..

our organization has a few vacant positions and you are planning to use the Google Forms service to prepare a pre-interview questionnaire for job applicants. You have created a form and it has all the standard fields where candidates can enter their name, email address, website URL, phone number, zip code and other essential details.
The form is ready for publishing online but before you make it live, how would you ensure that candidates have entered data in the correct format? And even if the format is proper, is the data itself valid? Can you add a CAPTCHA to Google forms to prevent spam bots? Can you include a profanity filter to block people from submitting entries that include obscene words?
When you are expecting dozens, or even hundreds, of responses in your Google Forms, it is always a good idea to have some rules in place and respondents data should be matched against these rules even before they submit the form. For instance, if your form is asking for a person’s year of birth, they should only be allowed to enter a number between 1900 and 2014.
Advanced data validation in Google Forms using RegEx (regular expressions)
Advanced data validation in Google Forms using RegEx (regular expressions)

Regular Expressions in Google Forms

Google Forms makes it relatively easy to add such advanced date validation rules to individual fields through Regular Expressions (or regex or regexp). Think of them as search patterns and every character entered in a form field is matched against that pattern – the form can only be submitted if the patter and the user-input matches.
Let’s understand this with a real-world example.
Say your Google form expects the user to enter their year of birth. At the time of designing the form, expand the “Data Validation” section below the form field (see screenshot above) and choose Regular Expression from the drop-down. Next select “Matches” in the other drop-down and enter ^(19\d{2}|20[0-1]\d)$ in the input field. The field will now accept input value like 1920, 2010 but would reject other values that fall outside the range.

Regular Expressions for Common Form Fields

A regular expression may appear gibberish but they aren’t so difficult to read and understand if you can know the basic rules of the language. What you see here is a compilation of some useful regular expressions that can be used to validate common form fields like URLs, phone numbers, zip codes, dates, etc.
1. Postal Address – allow only alphanumeric characters, spaces and few other characters like comma, period and hash symbol in the form input field.
[a-zA-Z\d\s\-\,\#\.\+]+
2. ZIP Code – the regex allows ZIP codes in standard formats and it matches both US and Indian pincodes.
^\d{5,6}(?:[-\s]\d{4})?$
3. Date – accept date input in the mm/dd/yyyy or mm-dd-yyyy formats.
((0[1-9])|(1[0-2]))[\/-]((0[1-9])|(1[0-9])|(2[0-9])|(3[0-1]))[\/-](\d{4})
Also see: Get Google Form Data by Email
4. Email Address – the regex below should match most common email address formats, including Gmail aliases that accept the “+” sign but there’s no perfect solution.
[a-zA-Z0-9_\.\+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-\.]+
5. URL (Web domain) – this is useful for fields that require the user to enter their website address and it even matches the upcoming TLDs like .directory or .restaurant. The other regex matches YouTube URL including those using the youtu.be domains.
https?\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,}
https?\:\/\/(www\.)?youtu(\.)?be(\.com)?\/.*(\?v=|\/v\/)?[a-zA-Z0-9_\-]+
6. Character Limit – the default text box in a Google form allows users to input any number of characters but you can impose a limit with the help of regular expression. Here we limit the input to 140 characters much like Twitter.
[\w]{1,140}
7. Phone Numbers – these are often a series of numbers preceded by an optional “+” sign and the area code may be inside brackets.
\+?\(?\d{2,4}\)?[\d\s-]{3,}
8. Price (with decimal) – if a form field requires users to enter a price of an item in their own currency, this regex will help. Replace the $ sign with your own currency symbol.
\$?\d{1,3}(,?\d{3})*(\.\d{1,2})?
9. Complex Password – only accept a string that has 1 uppercase alphabet, 1 lowercase alphabet, 2 digits and 1 special character. Also the minimum allowed length is 8 characters.
(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9].*[0-9])(?=.*[^a-zA-Z0-9]).{8,}
10. CAPTCHA – Google forms do not offer CAPTCHAs but you can create one using regex. Here’s a simple captcha that requires users to answer a simple question – what is 2+2?
^(4|[Ff][Oo][Uu][Rr])$.m