A little math before Facebook

Shantell wanted her Facebook bookmark to make her solve a math problem before letting her in. That sounded like a perfectly reasonable little programming project. 🙂

I made it as a bookmarklet instead of a browser extension. The bookmark runs a small JavaScript function, asks a randomly generated multiplication or percentage question with prompt(), and keeps asking until the answer is right. Then it sends the browser to Facebook.

There are easier and harder versions, depending on how much arithmetic you want standing between you and the news feed. It is not really blocking Facebook; typing the address still works. It is just a little speed bump attached to the bookmark we actually use. I like projects this size: somebody has a slightly unusual request, and a few lines of JavaScript make it happen.

See the bookmarklets