urmaul / rss-pipes
2.0.0
2019-02-05 09:46 UTC
Requires
- php: ^7.1.3
- beberlei/assert: ^2.6
- dg/rss-php: ^1.1
- symfony/yaml: ^3.0
- urmaul/httpclient: ^1.1.0
Requires (Dev)
- phpunit/phpunit: ~4.0
Suggests
- urmaul/rss-pipes-selector: Allows to parse html pages to create rss feeds.
README
由Yahoo Pipes启发的RSS订阅管理工具。它没有管道编辑界面 - 你只需在.yml
文件中进行配置,并将它们的URL复制到你的阅读器中。
使用方法
最简单的应用程序
只需创建一个包含以下内容的index.php
文件。
<?php require '../vendor/autoload.php'; $pipesDir = __DIR__ . '/../pipes'; \rsspipes\View::run($pipesDir);
然后你创建一个包含你的管道配置的pipes
目录。例如,你可以创建一个名为urmaul.yml
的配置,内容如下。
# urmaul.com without yii --- - type: atom url: http://urmaul.com/atom.xml - type: block rules: title: Yii
打开index.php?pipe=urmaul
,你会看到urmaul.com博客的RSS订阅,但不包含关于Yii的文章。
可用部分
Rss
解析RSS订阅。
Atom
解析Atom订阅。
过滤器
仅保留满足条件的项目。
阻止
丢弃满足条件的项目。
回调
使用回调处理订阅或项目。
替换
在属性内部替换子字符串。
参数
- attribute - 我们想替换子字符串的属性。
- search - 我们想替换的子字符串。
- replace - 我们想替换成的子字符串。
示例
- type: replace attribute: title search: space replace: spaaace
管道
运行独立的管道并将结果添加到订阅中。