命令行聚合源监视器,类似tail -f
项目描述
Rsstail是一个命令行聚合源监视器,其行为类似于tail -f。Rsstail(Python/feedparser)受到rsstail(C/libmrss)的启发,但提供了更多可定制的输出格式和额外的功能。
用法
$ rsstail --help Usage: rsstail [options] <url> [<url> ...] General Options: -v --verbose increase verbosity -V --version show version and exit -h --help show this help message and exit -x --help-format show formatting help and exit Feed Options: -i --interval <arg> poll every <arg> seconds -e --iterations <arg> poll <arg> times and quit -n --initial <arg> initially show <arg> items -w --newer <arg> show items newer than <arg> -b --bytes <arg> show only <arg> description/comment bytes -r --reverse show in reverse order -s --striphtml strip html tags -o --nofail do not exit on error -q --unique skip duplicate items Format Options: -t --timestamp show local timestamp -T --utc-timestamp show utc timestamp -l --title show title -u --url show url -d --desc show description -p --pubdate show publication date -U --updated show last update date -a --author show author -c --comments show comments -g --no-heading do not show headings -m --time-format <arg> date/time format -f --format <arg> output format (overrides other format options) Examples: rsstail --timestamp --pubdate --title --author <url1> <url2> <url3> rsstail --reverse --title <url> <username:password@url> rsstail --interval 60|60s|5m|1h --newer "2011/12/20 23:50:12" <url> rsstail --format '%(timestamp)-30s %(title)s %(author)s\n' <url> rsstail --format '{timestamp:<30} {title} {author}\n' <url>
$ rsstail --help-format Format specifiers must have one the following forms: %(placeholder)[flags]s {placeholder:flags} Examples: --format '%(timestamp)s %(pubdate)-30s %(author)s\n' --format '%(title)s was written by %(author)s on %(pubdate)s\n' --format '{timestamp:<20} {pubdate:^30} {author:>30}\n' Time format takes standard 'sprftime' specifiers: --time-format '%Y/%m/%d %H:%M:%S' --time-format 'Day of the year: %j Month: %b' Useful flags in this context are: %(placeholder)-10s - left align and pad %(placeholder)10s - right align and pad {placeholder:<10} - left align and pad {placeholder:>10} - right align and pad {placeholder:^10} - center align and pad Available placeholders: author comments created desc expired id link pubdate timestamp title updated utc-timestamp
请注意,仅当Python >= 2.7时,才可用{placeholder:flags}样式占位符。
安装
可以从pypi安装rsstail的最新稳定版本
$ pip install rsstail
或者简单地将独立的rsstail脚本放入您的$PATH并使其可执行
https://github.com/gvalkov/rsstail.py/releases/download/v0.5.0/rsstail.pyz.zip
输出着色
Rsstail的输出可以传输到许多控制台着色器之一。请考虑使用以下工具之一:clide、multitail、ccze、colorize、colorex或colout。
使用clide的示例
$ rsstail <options> \ | clide -e '/(Title|Pubdate|Author|Link|Description):/g,fg=yellow,bold' \ -e '/^.*FAILURE.*$/,fg=red,bold \
使用multitail的示例
# add to /etc/multitail.conf colorscheme:rsstail.py:console syndication feed monitor cs_re:red,,bold:^.*FAILURE.*$ cs_re:cyan:(:|/) cs_re:yellow:^.......... ..:..:.. cs_re:green:(Title|Author|Link|Pubdate): $ multitail -cS "rsstail.py" -l "rsstail <options>"
这两个例子仅仅触及了 clide 和 multitail 能做什么的一小部分。有关这些优秀项目的更多信息,请参阅其文档。
Shell 完成功能
Rsstail 随附 bash 和 zsh 的 shell 完成脚本。
bash: 将 rsstail.sh 复制到 /etc/bash_completion.d/。
zsh: 将 rsstail.zsh 复制到 $fpath 中的任何位置。
如果您正在安装系统全局版本,设置脚本将尝试将这些文件放置在正确的位置。
类似项目
许可
Rsstail 在 修订版 BSD 许可证 的条款下发布。
项目详情
下载文件
下载适用于您的平台文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。
源分布
rsstail-0.5.1.tar.gz (10.2 kB 查看哈希值)
构建分布
rsstail-0.5.1-py2.py3-none-any.whl (10.0 kB 查看哈希值)
关闭
rsstail-0.5.1.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 8ca70abe2ebddc3b66081e990637025e96562e092ee31af04a1f18274343e6dc |
|
MD5 | 777b7956b447b89d35c2f95cce4b74ad |
|
BLAKE2b-256 | 737b4afb26a9384894d1625008abd24d11060212eac805aa3aee569be785e4e5 |
关闭
rsstail-0.5.1-py2.py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 9ab270abf73ee4e3656ba617c606354bf2653348f392231b7926ac4558b3f6c8 |
|
MD5 | 665d5b9324d800150a58202400fa6a86 |
|
BLAKE2b-256 | ee2852ea3f4c05a4b1d51e6bd4a89f3dc7463d08a719c86732cc2812e59c3f4b |