Projects


handlebars-loader


Writing

Over-engineering a modern bookmarklet

The following takes you behind-the-scenes of building the bookcision bookmarklet which allows one to download their Kindle notes and highlights from the Amazon website.

Bookcision

Gruntfile

function getRandomNumber() {
    return 4; // chosen by fair dice roll.
              // guaranteed to be random.
}

Why Bookcision?

When highlights are created on any Kindle device, they are synced up to Amazon’s cloud. These are then visible at kindle.amazon.com, but there is no reason to believe that Amazon will continue to provide this service forever, and our ability to work with text in that hosted browser-based environment is limited.

We wanted a way cleanly to download our highlights onto our local computers, so we created a bookmarklet that permits one to excise highlights from the book’s kindle.amazon.com page.

Bookcision features

  • Easy to setup: just drag a bookmark to your bookmarks bar.
  • Browse your Kindle notes & highlights in an extremely easy-to-read format.
  • Download your Kindle notes & highlights as JSON, XML, or plain-text.
  • Copy-and-paste with the click of a button.

Technology overview

Due to the break-neck speed with which the JS landscape has been changing in the last few years, if I were to redo this project I would employ some new technologies, but alas this write-up is still valuable. I don’t know of any other write-ups of how to build a modern bookmarklet.

Bookmarklet bootstrapping

Webpack for bundling

Amazon APIs

Testing

Embedding analytics

Error Reporting with Rollbar

Deploying to Azure

Since Bookcision is deployed as just a single JS file, deployment entails pushing that JS file to a CDN. But don’t worry, I over-engineered that process too!

more

README

Welcome to your new blog! This is the default blog template with RSS, pagination and an archive. There are other templates available — run wintersmith new --help to list them.

more

A red herring

A long time ago, when the world was young — someone put some food on their tongue. They tasted the food, and thought it was nice. Most fruit liked it — but banana’s thought twice.

more