This repository has been archived by the owner. It is now read-only.
Simple crawler for histmag.org
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
histmag_to_kindle
test
.gitignore
LICENSE
MANIFEST
README.rst
requirements.txt
setup.py
tox.ini

README.rst

Histmag to kindle

Histmag to kindle is simple crawler for histmag web page. Reason I make such crawler is that I wanted to read historical articles on my kindle ebook reader but these articles are hard to send in one sane piece.

Installation

$ git clone
$ cd histmag_to_kindle
$ python setup.py install

Addtional requirements

Right now histmag_to_kindle requires mailgun account. Then export your API key and server to $PATH. Also you need to have KINDLEGEN in your $PATH for generating mobi files.

$ export KINDLEGEN=bin/kindlegen
$ export MAILGUN_API_KEY=your_api_key
$ export EMAIL_SERVER=your_email

After this make sure that you add mailgun email to kindle trusted emails:

Amazon.com -> Your account -> Manage Your Content and Devices -> Log in -> Settings tab -> Approved Personal Document E-mail List

Usage

import os
from histmag_to_kindle import Parser, HtmlGenerator, send_email_to_kindle

parser = Parser(http_link_to_desired article)
articles = parser.get_articles()
generator = generate_mobi(articles)
send_email_to_kindle(kindle_email='your_kindle_email', name=os.path.join(generator, 'histmag.mobi'))

Word from author

Histmag is great service but it needs money to run so disable adblock or buy their books.