This is a chrome plugin and a tiny backend web.py based webapp to convert web pages into .mobi files that can be read on an Amazon Kindle ebook reader.
There are a few excellent plugins (e.g. send to kindle) out there that do this kind of thing using an online service and Amazon's conversion service.
Being a little paranoid about privacy and such things myself, I wanted a system that didn't rely on using a 3rd party service and Amazon's conversion service which keeps track of all documents converted.
This program and the conversion service is completely on ones own computer and so is "self contained".
There is a chrome plugin (extension.crx) which you can install into your Chrome browser. A little button will pop up next to your URL bar which you can click on a page to have it rendered into a .mobi file that you can drop onto your Kindle to read.
There is also a "back end" server which you need to run to actually do the conversions. This is a python app that uses web.py so you need to install that inside a virtualenv and then start the server (refer Installation section below).
The actual work of conversion is accomplished using pandoc, lynx, calibre and so you need these three programs installed as well. You'll also need Gnu wget to fetch the page before conversion.
This whole thing is not tinker free and needs some time and tinkering to setup. Please fork the project and send it a pull request if you can improve it in any way. It currently "works for me".
-
Install
pandoc,lynx,calibreandwget. On Debian, you can do this usingsudo apt-get install pandoc lynx calibre wget
-
Install
pythonusingapt-get install python -
Install
virtualenvusingapt-get install python-virtualenv -
Create a virtualenv using
virtualenv ~/mobify. -
Activate this virtualenv and install
web.pyinside it using. ~/mobify/bin/activateand thenpip install web.py. -
Checkout the
mobifyapp and edit theapp.pyfile inside theappdirectory. In the line that saysdef convert_to_mobi(input_file, fname, save_dir = "/home/noufal/Downloads/kindle"), edit thesave_dirparameter to indicate where you want the.mobifiles to be generated. -
Start the web server using
python app.py 9090. You need to run this while thevirtualenvis activated. -
Load the
extension.crxin Chrome to make it install it. -
Now the
.mobibutton should show up for you to use. Click on it while on some page and you should be able to see debug output on the terminal where the python app is running.
Please report issues to me.
Once you get the setup above working, using the system is just a button click. Your files will get created in the save directory and you can put them onto your kindle when you want.
The backend doesn't do much sanitisation so if you have a version of the page that is formatted for print, please convert that instead of the web version. You will probably get better results.
I plan to optimise the backend for sites that I usually need to get content from so that I get better conversions.
The backend app and the plugin are licensed under the AGPL.