从Twitter或乳齿象搜索生成RSS源
twootfeed的Python项目详细描述
python twootfeed
从解析的Twitter或乳齿象搜索和乳齿象收藏夹生成RSS源
rss提要只显示原始的tweets(而不是retweets)和toots,其中:
- 链接到:
- 推特上的推特或乳齿象上的嘟嘟声
- 标签
- 用户名
- 网址
- 图像
- 来源
- 位置(仅适用于Twitter)
- tweets、boots和toots的转发和喜欢次数
(见下面的示例)。
要求
- Python3.6+
- API键Twitter和/或乳齿象
安装和配置
- 从PIP安装
$ pip install twootfeed
- 初始化配置文件
$ twootfeed_init
填写您将在'~/.config/twootfeed/config.yml'中使用的客户机字段:
- 对于twitter:请参见https://apps.twitter.com
在config.yml文件('consumerkey'和'consumersecret')中复制/粘贴twitter api键值 - 关于乳齿象:请参见Python wrapper for the Mastodon API
使用包含的脚本,该脚本将注册您的应用程序并提示您登录,为您创建凭据文件。
$ twootfeed_create_mastodon_cli
- 对于twitter:请参见https://apps.twitter.com
可以使用以下环境变量更改文件位置:
variable | description | app default value |
---|---|---|
^{ | configuration and credentials files directory | '~/.config/twootfeed/' |
^{ | config file full path | config dir + 'config.yml' => with default value: '~/.config/twootfeed/config.yml' |
^{ | application log file | no default value (log printed on the console) |
- 启动应用程序
$ twootfeed
用法
rss源可在以下url上找到:
- 对于Twitter:http://localhost:8080/<;关键字>;或http://localhost:8080/tweets/<;关键字>;
- 乳齿象:
- 搜索:
- 关键字作为标签:http://localhost:8080/toots/<;hashtag>;(不带前导符号)
- 查询:http://localhost:8080/toot_search/<;query>;
- 连接的用户收藏夹:http://localhost:8080/toot_favorites
- 搜索:
示例
在Twitter上搜索
rss提要中的结果:
在freshrss上显示,这是一个很棒的免费自托管聚合器(https://github.com/FreshRSS/FreshRSS):
搜索乳齿象
rss提要中的结果:
在freshrss上显示:
贡献
贡献者
感谢:
- georgedorn用于添加:
- 使用经过身份验证的用户收藏夹生成RSS源
- 注册应用程序并生成乳齿象凭据的脚本