dlhn
dlhn is a Python CLI script to download my comments and submissions from the Hacker News API and generate a static HTML archive with a Jinja2 template
Features
Download comments and submissions from the Hacker News API
Archive comment trees and submissions as JSON
Archive comment trees and submissions as static HTML with a Jinja2 HTML template
Aggressively cache entries that couldn’t have changed with a two-layer caching system that includes requests_cache and a sqlite database
Installation
Install dlhn with pip:
pip install dlhn
# pip install -e git+https://github.com/westurner/dlhn#egg=dlhn
Usage
Call dlhn:
dlhn -u dlhntestuser -o index.html --expire-newerthan 14d
Optionally, create a repo for e.g. GitHub Pages and add a Makefile:
# hnlog Makefile
USERNAME:=dlhntestuser
default: backup
install:
pip install -e git+https://github.com/westurner/dlhn#egg=dlhn
backup:
@# items with a cachetime newer than 14d ago may need to be pulled again
@# because they may not be locked yet (cachetime != item_time)
dlhn -u '$(USERNAME)' -o index.html --expire-newerthan 14d
backup-nocache:
dlhn -u '$(USERNAME)' -o index.html
commit:
git add ./index.html ./index.html.json ./dlhn.sqlite && \
git commit -m ":books: Updated index.html, index.html.json, and dlhn.sqlite"
push:
git push
all: backup commit push
And pass USERNAME as an arg when calling make:
make all USERNAME=dlhntestuser
References
Hacker News Guidelines: https://news.ycombinator.com/newsguidelines.html
Hacker News API docs: https://github.com/HackerNews/API
License
BSD License
dlhn archives pubicly available comments and submissions from the Hacker News API for noncommercial use to make searching one-page with ‘Ctrl-F’ easy.
Credits
History
0.2.5 (2019-04-17)
Update README.rst
0.2.4 (2019-04-17)
Update docs with pip package name
Update HISTORY.rst
0.2.3 (2019-04-17)
Add a setup.py
Add a few tests
First release on PyPI.
0.1.0 (2017-11-28)
Simple python script
Metadata
Release files for dlhn 0.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| dlhn-0.2.5.tar.gz | 15.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dlhn-0.2.5-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 25.3 kB
Release files / dlhn-0.2.5.tar.gz
| Download URL | dlhn-0.2.5.tar.gz |
|---|---|
| Size | 15.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9ea5ed007fa9cb78547ec0bd4eddba82346cafafdea6777cd244abd9f4079f12
|
|
BLAKE2b-256 checksum How to use checksums |
50cb5619a505073f248517e3383176feae2b0dfc2d1eecc0881e1cc67ce62d71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
|
Release files / dlhn-0.2.5-py2.py3-none-any.whl
| Download URL | dlhn-0.2.5-py2.py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
809f31be99e670d6402ff52c831d175d4f02ecab04f55ba4653516c419f5edb8
|
|
BLAKE2b-256 checksum How to use checksums |
b6efd6d5d74b524435d7540ac574065a342df8333d11ecc0ebcb9a5a82e3ac3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
|
Security for dlhn 0.2.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.