Verbose Logging

software development with some really amazing hair

T + S G I F R

The What, Why, and How Of Kindlebility

· · Posted in Programming
Tagged with

Kindlebility is now Tinderizer

TL;DR

  • Kindlebility sends articles on the web to your Kindle.
  • It needs your Kindle email address (@free.kindle.com addresses are fine).
  • I don’t store your Kindle address or use it for anything else.
  1. Use Kindlebility to make a bookmarklet.
  2. Add kindle@darkhelmetlive.com to your Kindle Approved Email List.
  3. Click the bookmarklet on a page to send the article to your Kindle.

Moving on

I’ve been meaning to write some more about Kindlebility, since I’ve been making improvements to it, people are using it, and I’m getting feedback, so here it goes.

What

Kindlebility is an application I wrote after I got my Kindle. You give it your Kindle email address (free or regular), authorize the email it uses, and you get a bookmark that you can click on pretty much any page, and it will do some magic (described later) to send the page to your Kindle for easy reading.

Why

I was frustrated that I could send things to it to get converted and look pretty on the device, but there were always too many steps. Run this, save that, convert here, email, blah, blah, blah. I’m a programmer damnit! I can automate this.

I put it up online because it’s not the most expensive thing in the world to run, and I figured other people would find it useful as well. You probably don’t think you need this until you use it a few times, then the value really shows.

How

I wanted to use the Readability script to grab just the relevant content and get that onto my Kindle, with one click. Since Readability is already Javascript, I figured this would be a good case for nodejs. As it turns out, Readability was already ported to node, and I just had to integrate it. An added bonus of this, is you can sort of check to see what it’s going to produce by using the Readability script yourself.

I use wkhtmltopdf on the server to convert the HTML to a PDF, and then Postmark to send emails.

To communicate with the server, I use the socket.io library, since it talks to node with no problem, I get cross browser support, and it makes doing progress updates on the client side super simple.

I don’t need to store anything on the server side, so I don’t keep your Kindle email for anything. You can also just remove kindle@darkhelmetlive.com from your Kindle Approved Email List and I can’t send anything to it, so you don’t have to worry about spam.

The Bookmarklet

When you click the bookmarklet (if you have the latest bookmarklet), it adds a div to the page and sticks in the top left to let you know stuff is happening. Then it grabs the socket.io Javascript file if it needs it (most likely), and connects up to the server. It sends the server the URL and your Kindle email, and it takes it from there.

The Server

The server downloads the page, runs Readability on the content, and writes the new HTML out to a file. It kicks off a process to run wkhtmltopdf on the HTML file, which spits out a pretty decent looking PDF. It then reads that PDF, and POSTs it to Postmark (they have a REST API for email; awesome!) with “convert” as the subject. Amazon converts it for easier reading (allowing you to change font sizes, etc), and it gets sent to your Kindle, either over 3G or Wifi, depending on which Kindle you have and which email (free or regular) you put in the box.

The Source Code

If you don’t believe me on any of these points, feel free to check out the source code, available on Github.

Fin

That’s it! Go ahead and try it out. I’ll be working on it more, making further improvements, fixing bugs, and whatever else. If you have suggestions, comments, or if it’s not working quite right, please let me know. If you love it so much, there’s a donate button at the bottom of the page.

Enjoy!

http://kindlebility.darkhax.com/


Sharing is Caring