模拟tail-f的命令行联合feed监视器

rsstail的Python项目详细描述


rsstail是一个具有行为的命令行联合feed监视器 类似于tail -frsstail(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

请注意,{placeholder:flags}样式占位符是 仅适用于python>;=2.7

安装

rsstail的最新稳定版本可以从pypi

$ pip install rsstail

或者简单地将独立的rsstail脚本放在$PATH中并使 它可执行:

https://github.com/gvalkov/rsstail.py/releases/download/v0.5.0/rsstail.pyz.zip

着色输出

rsstail的'输出可以通过管道传输到多个控制台之一 着色剂。考虑使用下列工具之一:clidemultitailcczecolorizecolorexcolout

带有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>"

这两个例子几乎没有触及 multitail可以。参考这些优秀的 项目以获取更多信息。

外壳完成

rsstail附带了bash和zsh的shell完成脚本。

如果要在系统范围内安装,安装脚本将尝试 把这些文件放在正确的地方。

许可证

rsstail是根据Revised BSD License的条款发布的。

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

推荐PyPI第三方库


热门话题
IntelliJ中的java默认Maven项目结构不一致   java我希望链接(在帖子和页面上)在一些访问者加载时被自动点击   java如何使用单独的方法隐藏JButton并在新类中调用   java KStream leftJoin KStream具有相同的密钥   java图像在垂直滚动窗格视图端口中消失   java从指定的起始点开始以n的增量填充数组   java JLabel和JTextField不在swing表单中应用   java springboot mongo如果没有映像,请使用现有映像   类似C++映射的java容器   java如何在没有Valgrind错误的情况下调用JNI_CreateJavaVM?   java如何在安卓中运行后台服务   java onPostExecute不运行