dlhn是一个python cli脚本,用于从hacker news api下载我的评论和提交,并使用jinja2模板生成一个静态html存档

dlhn的Python项目详细描述


dlhn

https://img.shields.io/pypi/v/dlhn.svghttps://img.shields.io/travis/westurner/dlhn.svg

dlhn是一个python cli脚本,用于下载我的评论和提交 来自Hacker News API 并使用jinja2模板生成一个静态html归档文件

功能

  • 从Hacker News API下载评论和提交内容
  • 将注释树和提交文件归档为json
  • 将注释树和提交文件存档为静态HTML 使用Jinja2 HTML模板
  • 积极地缓存无法更改的条目 具有两层缓存系统,包括请求缓存 以及sqlite数据库

安装

使用pip安装dlhn:

pip install dlhn

# pip install -e git+https://github.com/westurner/dlhn#egg=dlhn

使用量

致电dlhn:

dlhn -u dlhntestuser -o index.html --expire-newerthan 14d

或者,为github页面创建一个repo并添加一个Makefile

# hnlog Makefile
USERNAME:=dlhntestuser

default:backupinstall:
    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:backupcommitpush

并在调用make

make all USERNAME=dlhntestuser

许可证

BSD许可证

DLHN存档公开的评论和提交 来自Hacker News API 对于非商业用途,使用“ctrl-f”可以轻松搜索一页。

历史记录

0.2.5(2019-04-17)

  • 更新readme.rst

0.2.4(2019-04-17)

  • 使用pip包名称更新文档
  • 更新history.rst

0.2.3(2019-04-17)

  • 添加setup.py
  • 添加一些测试
  • pypi上的第一个版本。

0.1.0(2017-11-28)

  • 简单的python脚本

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
我可以用C++代码使用java代码吗?   java使用JSR303在派生类中提供更具体的约束   java在这个查找唯一路径数算法中我做错了什么?   java如何为2个不同的服务提供商使用2个不同的SSL证书?   java在Gridview上绘制文本   java使用连接for循环构建字符串名   java StringBuilder拆分无法处理某些文件   java事件关注EditText   Java Web Start“找不到URL的缓存资源”   java程序从命令行运行的速度比在Eclipse中慢   java为什么HttpServletRequest会截断#字符上的url输入?   java自定义折叠工具栏平滑标题大小调整   使用Mockito对安卓 java中调用另一个静态函数的函数进行单元测试   http在java客户机中使用cachecontrol头   java如何使用。是否使用Delimiter从输入文件中排除标点符号和数字?   使用上下文作为参数/参数的java   java更有效地从Jar中提取文件   java为多个JButton提供相同的actionListener