Tip
简称rss2tg,用于将自定义RSS地址,字段,刷新时间里的相关帖子即时发送到自定义TG用户或频道,省去你刷帖子的时间
支持AMD64/ARM64
镜像大小17M,内存占用10M
——By drfyup
-
确保已安装 Docker 和 Docker Compose(方法自寻)。
-
克隆或下载项目代码到本地。
git clone https://github.com/3377/rss2tg.git
-
进入项目目录。
-
编辑
docker-compose.yml
文件,修改环境变量:
-- 进入任意目录或直接当前目录,新建docker-compose.yml文件,填入以下内容
version: '3'
services:
rss2tg:
container_name: rss2tg
image: drfyup/rss2tg:latest
volumes:
- ./config:/app/config
- ./data:/app/data
environment:
- TELEGRAM_BOT_TOKEN=your_bot_token_here
- TELEGRAM_USERS=user_id_1,user_id_2
- TELEGRAM_CHANNELS=@channel_1,@channel_2
- TZ=Asia/Shanghai
restart: unless-stopped
将your_bot_token_here
替换为您的 Telegram Bot Token,user_id_1,user_id_2
替换为您要接收消息的用户 ID,@channel_1,@channel_2
替换为您要发送消息的频道名称。
- 运行以下命令启动容器:
docker-compose up -d
- 构建 Docker 镜像:
docker pull drfyup/rss2tg:latest
- 运行 Docker 容器:
docker run -d \
--name rss2tg \
-v $(pwd)/config:/app/config \
-v $(pwd)/data:/app/data \
-e TELEGRAM_BOT_TOKEN=your_bot_token_here \
-e TELEGRAM_USERS=user_id_1,user_id_2 \
-e TELEGRAM_CHANNELS=@channel_1,@channel_2 \
-e TZ=Asia/Shanghai \
--restart unless-stopped \
drfyup/rss2tg:latest
请替换环境变量中的相应值。
程序支持通过 YAML 配置文件或环境变量进行配置。配置文件位于 /app/config/config.yaml
。如果该文件不存在,程序将使用环境变量进行初始配置。
环境变量读取优先级高于配置文件。
配置文件示例:
telegram:
bot_token: "your_bot_token_here"
users:
- "user_id_1"
- "user_id_2"
channels:
- "@channel_1"
- "@channel_2"
#这里的tg配置优先级低于环境变量,如果填在这里,一分钟后才会读取此配置
rss:
- url: "https://example.com/feed1.xml"
interval: 300
keywords:
- "keyword1"
- "keyword2"
group: "Group1"
- url: "https://example.com/feed2.xml"
interval: 600
keywords:
- "keyword3"
group: "Group2"
Bot 支持以下命令:
/start
- 开始使用机器人/help
- 获取帮助信息/config
- 查看当前配置/add
- 添加 RSS 订阅/edit
- 编辑 RSS 订阅/delete
- 删除 RSS 订阅/list
- 列出所有 RSS 订阅/stats
- 查看推送统计
- 发送
/add
命令给 Bot。 - 按提示输入 RSS 订阅的 URL。
- 输入更新间隔(秒)。
- 输入关键词(用逗号分隔,如果没有可以直接输入 1)。
- 输入组名。
在当前config目录下新建config.ymal,填入以下内容。
rss:
- url: https://rss.nodeseek.com
interval: 30
keywords:
- vps
- 甲骨文
- 免费
group: NS论坛
- url: https://linux.do/latest.rss
interval: 30
keywords:
- vps
- 甲骨文
- 免费
- 龟壳
group: LC论坛
两种方式都可以,系统会每1分钟自动检测,即使动态更改生效。
- 发送
/edit
命令给 Bot。 - 输入要编辑的 RSS 订阅编号。
- 按提示修改 URL、更新间隔、关键词和组名。如果不需要修改某项,直接输入 1。
- 发送
/delete
命令给 Bot。 - 输入要删除的 RSS 订阅编号。
发送 /list
命令给 Bot,查看当前所有 RSS 订阅。
发送 /stats
命令给 Bot,查看今日和本周的推送数量。
- 确保 Docker 容器有足够的权限访问
config
和data
目录。 - 如果修改了配置文件,需要重启 Docker 容器以使更改生效。
- 推送统计数据保存在
/app/data/stats.yaml
文件中。 - 已发送的项目记录保存在
/app/data/sent_items.txt
文件中。
- 如果 Bot 无响应,请检查 Telegram Bot Token 是否正确。
- 如果无法接收消息,请确保已将您的用户 ID 添加到配置中。
- 查看 Docker 容器日志以获取更多信息:
docker logs rss2tg
如有其他问题,请参考项目的 GitHub 页面或提交 issue。
Tip
*** Referred to as rss2tg, it is used to instantly send related posts in custom RSS addresses, fields, and refresh times to custom TG users or channels, eliminating the time for you to swipe posts.***
*** Support AMD64/ARM64***
*** Image size 17M, memory footprint 10M***
——By drfyup
-
Make sure that Docker and Docker Compose are installed (the method is self-searching).
-
Clone or download the project code locally.
git clone https://github.com/3377/rss2tg.git
-
Enter the project directory.
-
Edit 'docker-compose.yml' file, modify environment variables:
-- Enter any directory or directly the current directory and create a new docker-compose.yml file, fill in the following content
version: '3'
services:
rss2tg:
container_name: rss2tg
image: drfyup/rss2tg:latest
volumes:
- ./config:/app/config
- ./data:/app/data
environment:
- TELEGRAM_BOT_TOKEN=your_bot_token_here
- TELEGRAM_USERS=user_id_1,user_id_2
- TELEGRAM_CHANNELS=@channel_1,@channel_2
- TZ=Asia/Shanghai
restart: unless-stopped
Replace your_bot_token_here
with your Telegram Bot Token, user_id_1, user_id_2
with the user ID you want to receive the message, and @channel_1, @channel_2
with the channel name you want to send the message, TZ=Asia/Shanghai
with your timezone settings.
- Run the following command to start the container:
docker-compose up -d
- Build a Docker image:
docker pull drfyup/rss2tg:latest
- Run the Docker container:
docker run -d \
--name rss2tg \
-v $(pwd)/config:/app/config \
-v $(pwd)/data:/app/data \
-e TELEGRAM_BOT_TOKEN=your_bot_token_here \
-e TELEGRAM_USERS=user_id_1,user_id_2 \
-e TELEGRAM_CHANNELS=@channel_1,@channel_2 \
-e TZ=Asia/Shanghai \
--restart unless-stopped \
drfyup/rss2tg:latest
Please replace the corresponding value in the environment variable.
The program supports configuration through YAML configuration files or environment variables.The configuration file is located in/app/config/config.yaml
.If the file does not exist, the program will use environment variables for initial configuration.
The reading priority of environment variables is higher than that of configuration files.
Configuration file example:
telegram:
bot_token: "your_bot_token_here"
users:
- "user_id_1"
- "user_id_2"
channels:
- "@channel_1"
- "@channel_2"
#The priority of the tg configuration here is lower than that of the environment variable. If you fill in here, this configuration will not be read until one minute later.
rss:
- url: "https://example.com/feed1.xml"
interval: 300
keywords:
- "keyword1"
- "keyword2"
group: "Group1"
- url: "https://example.com/feed2.xml"
interval: 600
keywords:
- "keyword3"
group: "Group2"
The Bot supports the following commands:
-/start
-Start using the robot
-/help
-Get help information
-/config
-View current configuration
-/add
-add RSS subscription
-/edit
-edit RSS feed
-/delete
-delete RSS feed
-/list
-list all RSS feeds
-/statistics
-View push statistics
- Send the `/add' command to the Bot.
- Press the prompt to enter the URL of the RSS subscription.
- Enter the update interval (seconds).
- Enter keywords (separated by commas, if not, you can directly enter 1).
- Enter the group name.
Create a new config in the current config directory.ymal, fill in the following.
rss:
- url: https://rss.nodeseek.com
interval: 30
keywords:
- vps
-Oracle
-Free
group: NS Forum
- url: https://linux.do/latest.rss
interval: 30
keywords:
- vps
-Oracle
-Free
-Turtle shell
group: LC Forum
Both methods are possible, the system will automatically detect every 1 minute, even if the dynamic changes take effect.
- Send the `/edit' command to the Bot.
- Enter the RSS subscription number you want to edit.
- Follow the prompts to modify the URL, update interval, keywords, and group name.If you don't need to modify an item, enter 1 directly.
- Send the `/delete' command to the Bot.
- Enter the RSS subscription number you want to delete.
Send the `/list' command to the Bot to view all current RSS feeds.
Send the `/statistics' command to the Bot to check the number of pushes for today and this week.
-Make sure that the Docker container has sufficient permissions to access the 'config and'data
directories.
-If the configuration file is modified, the Docker container needs to be restarted for the changes to take effect.
-Push statistics are saved in/app/data/statistics.In the yaml' file. -The sent project records are saved in
/app/data/sent_items.txt` file.
-If the Bot is unresponsive, please check whether the Telegram Bot token is correct. -If the message cannot be received, please make sure that your user ID has been added to the configuration. -View the Docker container log for more information:
docker logs rss2tg
If you have other questions, please refer to the project's GitHub page or submit an issue.