1
1
# NodeRSSBot
2
+
2
3
Another telegram RSSBot in Node.js
3
4
4
5
A RSSBot in telegram similar to [ https://github.com/iovxw/rssbot/ ] ( https://github.com/iovxw/rssbot/ ) . But this time in Node.js.
5
6
6
7
# Support version
8
+
7
9
RSS is parsered using [ rss-parser] ( https://www.npmjs.com/package/rss-parser )
8
10
9
11
# Usage
12
+
10
13
The same as [ https://github.com/iovxw/rssbot/ ] ( https://github.com/iovxw/rssbot/ )
11
14
12
15
```
@@ -19,75 +22,85 @@ The same as [https://github.com/iovxw/rssbot/](https://github.com/iovxw/rssbot/)
19
22
/viewall - view all subscriptions and number of subscribers need to enable in settings
20
23
```
21
24
22
- You can add channel id to subscribe a feed for a channel in private chat after add the bot as administrator
25
+ You can add channel id to subscribe a feed for a channel in private chat after add the bot as administrator
23
26
for example ` /sub <channel id > <feed url> ` (channel id is startwith @)
24
-
25
- You can send a opml file directly to import feed
26
- viewall can only be uesed in private chat
27
+
28
+ You can send a opml file directly to import feed
29
+ viewall can only be uesed in private chat
27
30
28
31
# Depolyment
32
+
29
33
## Docker
34
+
30
35
### Use autobuild docker image
36
+
31
37
After install docker
38
+
32
39
1 . Run` docker pull fengkx/node_rssbot `
33
- 1 . Run ` docker run --name rssbot -d -v <directory to store database file>:/app/data/ -e RSSBOT_TOKEN=<YOUR_TGBOT_TOKEN> fengkx/node_rssbot `
40
+ 1 . Run ` docker run --name rssbot -d -v <directory to store database file>:/app/data/ -e RSSBOT_TOKEN=<YOUR_TGBOT_TOKEN> fengkx/node_rssbot `
34
41
35
- for exmaple ` docker run --name rssbot -d -v /var/data:/app/data/ -e RSSBOT_TOKEN=123456:abcdef123456-U fengkx/rssbot `
42
+ for exmaple ` docker run --name rssbot -d -v /var/data:/app/data/ -e RSSBOT_TOKEN=123456:abcdef123456-U fengkx/rssbot `
36
43
37
44
### Build docker locally
45
+
38
46
1 . Install Docker
39
47
1 . clone this repository ` git clone https://github.com/fengkx/NodeRSSBot.git `
40
48
1 . Run ` docker build . ` then you will get a image id
41
- 1 . Run` docker run --name rssbot -d -e RSSBOT_TOKEN=<YOUR_TGBOT_TOKEN> <YOUR_IMAGE_ID> `
49
+ 1 . Run` docker run --name rssbot -d -e RSSBOT_TOKEN=<YOUR_TGBOT_TOKEN> <YOUR_IMAGE_ID> `
42
50
43
- for example ` docker run --name rssbot -d -e RSSBOT_TOKEN=123456:abcdef123456-U fd54321bff2 `
51
+ for example ` docker run --name rssbot -d -e RSSBOT_TOKEN=123456:abcdef123456-U fd54321bff2 `
44
52
45
53
## PM2
54
+
46
55
1 . Node.js and npm installed
47
56
1 . clone this repository ` git clone https://github.com/fengkx/NodeRSSBot.git `
48
57
1 . Set the ` RSSBOT_TOKEN ` environment variable or set it in config/index.js
49
58
1 . Install dependencies run ` npm i ` in the root directory of the repository
50
59
1 . Run ` pm2 start index.js `
51
60
52
61
# Setting
53
- ** All setting can be set by either environment variable or in ` config/index.js ` **
54
62
63
+ ** All setting can be set by either environment variable or in ` config/index.js ` **
55
64
56
- | setting | env | default/require | description |
57
- | ------------------ | ---------------- | ---------------- | ---------------------------------------- |
58
- | token | RSSBOT_TOKEN | ** require** | [ telegram bot token] ( https://core.telegram.org/bots#3-how-do-i-create-a-bot ) |
59
- | db_path | RSSBOT_DB_PATH | data/database.db | path to store database file |
60
- | lang | RSSBOT_LANG | zh-cn | language |
61
- | item_num | RSSBOT_ITEM_NUM | 10 | send the laset number of item |
62
- | fetch_gap | RSSBOT_FETCH_GAP | 5m | fetch gap |
63
- | notify_error_count | NOTIFY_ERR_COUNT | 5 | error count when it will notfiy |
64
- | view_all | RSSBOT_VIEW_ALL | false | enable or not |
65
- | UA | RSSBOT_UA | 'Mozilla/5.0 NodeRSSBot(https://github.com/fengkx/NodeRSSBot)' | user-agent of requrest|
65
+ | setting | env | default/require | description |
66
+ | ------------------ | ---------------- | -------------------------------------------------------------- | ------------------------------------ ---------------------------------------- |
67
+ | token | RSSBOT_TOKEN | ** require** | [ telegram bot token] ( https://core.telegram.org/bots#3-how-do-i-create-a-bot ) |
68
+ | db_path | RSSBOT_DB_PATH | data/database.db | path to store database file |
69
+ | lang | RSSBOT_LANG | zh-cn | language |
70
+ | item_num | RSSBOT_ITEM_NUM | 10 | send the laset number of item |
71
+ | fetch_gap | RSSBOT_FETCH_GAP | 5m | fetch gap |
72
+ | notify_error_count | NOTIFY_ERR_COUNT | 5 | error count when it will notfiy |
73
+ | view_all | RSSBOT_VIEW_ALL | false | enable or not |
74
+ | UA | RSSBOT_UA | 'Mozilla/5.0 NodeRSSBot(https://github.com/fengkx/NodeRSSBot)' | user-agent of requrest |
66
75
67
- language can be setting in ` zh-cn ` or ` en `
76
+ language can be setting in ` zh-cn ` or ` en `
68
77
69
78
fetch_gap can be setting in how many minutes or hours。m for minute, h for hour
70
-
79
+
71
80
for example 5m means every 5 minutes, 1h means every 1 hour
72
81
73
82
# i18n
74
83
75
84
translate the file in ` i18n ` in the another yaml and make a pull request (๑•̀ㅂ•́)و✧
76
85
77
- ---------------
86
+ ---
87
+
78
88
# 中文文档
79
89
80
90
# NodeRSSBot
91
+
81
92
又是一个 telegram RSS Bot 不过这次用的是 Node.js
82
93
83
- 模仿[ https://github.com/iovxw/rssbot/ ] ( https://github.com/iovxw/rssbot/ ) 做的一个RSSBot ,用[ telegraf] ( https://www.npmjs.com/package/telegraf )
84
- 首先感谢 iovxw 的 RSSBot 一直用的很好
85
- 做这个东西只是为了,配置起来更方便一些不用安装Rust的工具链和编译
94
+ 模仿[ https://github.com/iovxw/rssbot/ ] ( https://github.com/iovxw/rssbot/ ) 做的一个 RSSBot ,用[ telegraf] ( https://www.npmjs.com/package/telegraf )
95
+ 首先感谢 iovxw 的 RSSBot 一直用的很好
96
+ 做这个东西只是为了,配置起来更方便一些不用安装 Rust 的工具链和编译
86
97
87
98
# 支持的版本
99
+
88
100
RSS 解析用的是 [ rss-parser] ( https://www.npmjs.com/package/rss-parser ) ,它支持的就支持
89
101
90
102
# Usage
103
+
91
104
基本与 [ https://github.com/iovxw/rssbot/ ] ( https://github.com/iovxw/rssbot/ ) 一致
92
105
93
106
```
@@ -99,30 +112,34 @@ RSS 解析用的是 [rss-parser](https://www.npmjs.com/package/rss-parser),它
99
112
/export - 导出订阅到opml文件
100
113
/viewall - 查看所有订阅和订阅人数 需要在设置中打开
101
114
```
115
+
102
116
把 bot 设为频道管理员并正确配置权限后,可通过私聊在` /sub ` 后加上频道 id 来在频道中订阅 feed
103
117
例如 ` /sub <频道 id > <feed url> ` (频道 id 是@打头的)
104
118
105
- 直接发送opml文件,可以导入RSS源
119
+ 直接发送 opml 文件,可以导入 RSS 源
106
120
viewall 只能在私聊中使用
107
121
108
-
109
122
# 部署
123
+
110
124
## Docker
111
125
112
126
### 使用自动构建的 docker image
127
+
113
128
安装好了 docker 之后
129
+
114
130
1 . 运行` docker pull fengkx/node_rssbot `
115
- 1 . 运行 ` docker run --name rssbot -d -v <directory to store database file>:/app/data/ -e RSSBOT_TOKEN=<YOUR_TGBOT_TOKEN> fengkx/node_rssbot `
131
+ 1 . 运行 ` docker run --name rssbot -d -v <directory to store database file>:/app/data/ -e RSSBOT_TOKEN=<YOUR_TGBOT_TOKEN> fengkx/node_rssbot `
116
132
117
- 例如 ` docker run --name rssbot -d -v /var/data:/app/data/ -e RSSBOT_TOKEN=123456:abcdef123456-U fengkx/rssbot `
133
+ 例如 ` docker run --name rssbot -d -v /var/data:/app/data/ -e RSSBOT_TOKEN=123456:abcdef123456-U fengkx/rssbot `
118
134
119
135
### 本地构建
136
+
120
137
1 . 安装 Docker
121
138
1 . 克隆仓库 ` git clone https://github.com/fengkx/NodeRSSBot.git `
122
139
1 . 构建 docker image ` docker build . ` then you will get a image id
123
- 1 . 运行 ` docker run --name rssbot -d -e RSSBOT_TOKEN=<YOUR_TGBOT_TOKEN> <YOUR_IMAGE_ID> `
140
+ 1 . 运行 ` docker run --name rssbot -d -e RSSBOT_TOKEN=<YOUR_TGBOT_TOKEN> <YOUR_IMAGE_ID> `
124
141
125
- 例如 ` docker run --name rssbot -d -e RSSBOT_TOKEN=123456:abcdef123456-U fd54321bff2 `
142
+ 例如 ` docker run --name rssbot -d -e RSSBOT_TOKEN=123456:abcdef123456-U fd54321bff2 `
126
143
127
144
## PM2
128
145
@@ -133,29 +150,31 @@ viewall 只能在私聊中使用
133
150
1 . 推荐用 ` pm2 ` 守护进程 ` pm2 start index.js ` 如果没有安装` pm2 ` 就先安装 ` npm i -g pm2 `
134
151
135
152
# TODO
136
- - [x] export 命令
137
- - 代理
138
- - unit test
153
+
154
+ - [x] export 命令
155
+ - 代理
156
+ - unit test
139
157
140
158
# 配置项
141
- ** 所有配置项都可以用环境变量或者直接在 ` config/index.js ` 中修改**
142
159
160
+ ** 所有配置项都可以用环境变量或者直接在 ` config/index.js ` 中修改**
143
161
144
- | 设置项 | 环境变量 | 默认/必填 | 描述 |
145
- | ------------------ | ---------------- | ---------------- | ---------------------------------------- |
146
- | token | RSSBOT_TOKEN | ** require** | [ telegram bot token] ( https://core.telegram.org/bots#3-how-do-i-create-a-bot ) |
147
- | db_path | RSSBOT_DB_PATH | data/database.db | 数据库文件路径 |
148
- | lang | RSSBOT_LANG | zh-cn | 语言 |
149
- | item_num | RSSBOT_ITEM_NUM | 10 | 发送最新几条信息 |
150
- | fetch_gap | RSSBOT_FETCH_GAP | 5m | 抓取间隔 |
151
- | notify_error_count | NOTIFY_ERR_COUNT | 5 | 发出通知的错误次数 |
152
- | view_all | RSSBOT_VIEW_ALL | false | 是否开启 |
153
- | UA | RSSBOT_UA | 'Mozilla/5.0 NodeRSSBot(https://github.com/fengkx/NodeRSSBot)' | 请求的 user-agent |
162
+ | 设置项 | 环境变量 | 默认/必填 | 描述 |
163
+ | ------------------ | ---------------- | -------------------------------------------------------------- | ------------------------------------ ---------------------------------------- |
164
+ | token | RSSBOT_TOKEN | ** require** | [ telegram bot token] ( https://core.telegram.org/bots#3-how-do-i-create-a-bot ) |
165
+ | db_path | RSSBOT_DB_PATH | data/database.db | 数据库文件路径 |
166
+ | lang | RSSBOT_LANG | zh-cn | 语言 |
167
+ | item_num | RSSBOT_ITEM_NUM | 10 | 发送最新几条信息 |
168
+ | fetch_gap | RSSBOT_FETCH_GAP | 5m | 抓取间隔 |
169
+ | notify_error_count | NOTIFY_ERR_COUNT | 5 | 发出通知的错误次数 |
170
+ | view_all | RSSBOT_VIEW_ALL | false | 是否开启 |
171
+ | UA | RSSBOT_UA | 'Mozilla/5.0 NodeRSSBot(https://github.com/fengkx/NodeRSSBot)' | 请求的 user-agent |
154
172
155
173
语言可以设置为 ` zh-cn ` or ` en `
156
- 时间间隔可设置为每多少分钟或多少小时。m 表示分钟, h表示小时
174
+ 时间间隔可设置为每多少分钟或多少小时。m 表示分钟, h 表示小时
157
175
158
- 例如 5m 表示每5分钟 , 1h 表示每1小时
176
+ 例如 5m 表示每 5 分钟 , 1h 表示每 1 小时
159
177
160
178
# i18n
161
- 在 ` i18n ` 目录翻译yaml文件然后来个 ·pr· (๑•̀ㅂ•́)و✧
179
+
180
+ 在 ` i18n ` 目录翻译 yaml 文件然后来个 ·pr· (๑•̀ㅂ•́)و✧
0 commit comments