• Stars
    star
    1,521
  • Rank 30,802 (Top 0.7 %)
  • Language
    Rust
  • License
    The Unlicense
  • Created almost 8 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Lightweight Telegram RSS notification bot. 用于消息通知的轻量级 Telegram RSS 机器人

rssbot Build Status Github All Releases

Other Languages: English

Telegram RSS 机器人 @RustRssBot

支持:

  • RSS 0.9
  • RSS 0.91
  • RSS 0.92
  • RSS 0.93
  • RSS 0.94
  • RSS 1.0
  • RSS 2.0
  • Atom 0.3
  • Atom 1.0
  • JSON Feed 1

使用

/rss       - 显示当前订阅的 RSS 列表
/sub       - 订阅一个 RSS: /sub http://example.com/feed.xml
/unsub     - 退订一个 RSS: /unsub http://example.com/feed.xml
/export    - 导出为 OPML

下载

可直接从 Releases 下载预编译的程序(带 zh 的为中文版), Linux 版本为 musl 静态链接, 无需其他依赖

编译

请先尝试从上面下载, 如不可行或者有其他需求再手动编译

先安装 Rust Nightly 以及 Cargo (推荐使用 rustup), 然后:

cargo build --release

编译好的文件位于: ./target/release/rssbot

运行

USAGE:
    rssbot [FLAGS] [OPTIONS] <token>

FLAGS:
    -h, --help          Prints help information
        --insecure      DANGER: Insecure mode, accept invalid TLS certificates
        --restricted    Make bot commands only accessible for group admins
    -V, --version       Prints version information

OPTIONS:
        --admin <user id>...        Private mode, only specified user can use this bot. This argument can be passed
                                    multiple times to allow multiple admins
    -d, --database <path>           Path to database [default: ./rssbot.json]
        --max-feed-size <bytes>     Maximum feed size, 0 is unlimited [default: 2097152]
        --max-interval <seconds>    Maximum fetch interval [default: 43200]
        --min-interval <seconds>    Minimum fetch interval [default: 300]

ARGS:
    <token>    Telegram bot token

NOTE: You can get <user id> using bots like @userinfobot @getidsbot

<token> 请参照 这里 申请

环境变量

  • HTTP_PROXY: 用于 HTTP 的代理
  • HTTPS_PROXY: 用于 HTTPS 的代理
  • RSSBOT_DONT_PROXY_FEEDS: 设为 1 使所有订阅的 RSS 不通过代理(仅代理 Telegram)
  • NO_PROXY: 暂不支持,等待 reqwest#877

从旧的 RSSBot 迁移

对于 原先 Clojure 版本的 Bot, 可以使用以下脚本转换数据库

#!/bin/bash

DATABASE=$1
TARGET=$2

DATA=$(echo "SELECT url, title FROM rss;" | sqlite3 $DATABASE)
IFS=$'\n'

echo -e "[\c" > $TARGET
for line in ${DATA[@]}
do
    IFS='|'
    r=($line)
    link=${r[0]}
    title=${r[1]}

    echo -e "{\"link\":\"$link\"," \
            "\"title\":\"$title\"," \
            "\"error_count\":0," \
            "\"hash_list\":[]," \
            "\"subscribers\":[\c" >> $TARGET

    subscribers=$(echo "SELECT subscriber FROM subscribers WHERE rss='$link';" | sqlite3 $DATABASE)
    IFS=$'\n'
    for subscriber in ${subscribers[@]}
    do
        echo -e "$subscriber,\c" >> $TARGET
    done

    echo -e "]},\c" >> $TARGET
done
echo "]" >> $TARGET
sed -i "s/,]/]/g" $TARGET

参数 1 为旧数据库地址, 2 为结果输出地址

需要注意的是已推送的 RSS 记录不会保留, 如果直接使用转换后的数据库, 会重复推送旧的 RSS

License

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

More Repositories

1

Stepladder

梯子
143
star
2

downloader

HTTP file downloader
Go
68
star
3

ksni

A Rust implementation of the KDE/freedesktop StatusNotifierItem specification
Rust
62
star
4

fcitx5-simple-theme

A simple theme for fcitx5
32
star
5

tcprp

A simple TCP reverse proxy
Go
24
star
6

chez-json

A JSON library for Chez Scheme
Scheme
14
star
7

gleipnir

Per-process Network Firewall/Rate Limiter/Monitor for Linux Desktop
Rust
14
star
8

tg-rss-bot

中文 Telegram RSS 机器人
Clojure
13
star
9

bismuth

Wallpaper generator
Clojure
12
star
10

nsm

Linux Network Speed Monitor
Go
10
star
11

dynamic-dns-for-dnspod

DNSPod动态DNS设置工具
Go
9
star
12

go2html5

Go
7
star
13

biying

Biying Wallpaper for Linux
Rust
7
star
14

jandan_pic_bot

Rust
6
star
15

wifikey

wifi万能钥匙客户端实现
Go
6
star
16

plasmodesmata

Tunnel TCP over HTTP2 with Multiplexing
Rust
6
star
17

gohtml

Golang HTML模板工具
Go
4
star
18

elixir-stepladder

Elixir
4
star
19

bangumi

新番放送时间表,命令行版
Go
4
star
20

OwO

一个简单的颜文字输入工具
Nim
4
star
21

enable-gles3_1-and-aep

Magisk Module
Shell
4
star
22

gopkg

Golang package manager
Go
4
star
23

pool

goroutine pool
Go
3
star
24

todolist

网页版代办事项列表
Go
3
star
25

device-thwc-ufi001c

postmarketOS for Tong Heng Wei Chuang ufi-001c/ufi-001b 4G Modem Stick
Shell
3
star
26

iugytf

An Kaomoji bot for Telegram, use inline mode
Clojure
3
star
27

csug9

Chez Scheme Version 9 User's Guide https://github.com/cisco/ChezScheme/tree/master/csug
HTML
3
star
28

MCore

Minecraft游戏启动核心,输入相应的参数会返回启动所需的参数等等
Go
2
star
29

pixiu

Rust
2
star
30

JandanLivere

给煎蛋添加第三方评论
JavaScript
2
star
31

iovxw.github.io

HTML
2
star
32

smbot

Clojure
2
star
33

chez-scheme-tcp-example

C
2
star
34

tcp-distributor

Rust
2
star
35

wowMC

Golang编写的简易Minecraft启动器
Go
2
star
36

chez-curl

Scheme
2
star
37

tsensor

A simple hardware temperature monitor for Linux with TUI
Rust
2
star
38

dot-vim

自用 vim 配置文件,基于 https://github.com/codepushr/vim-go-runtime
Vim Script
1
star
39

jsonpull

Json pull parser
Rust
1
star
40

nim-forum

简单的论坛程序
Nim
1
star
41

pinyin-order

A Rust library that helps sort a string vector by Pinyin. Rust 字符串向量按拼音排序
Rust
1
star
42

hex98

My honeycomb keyboard
Jupyter Notebook
1
star
43

telegram-cache-decrypt

For poor guys who don't have Xposed installed
Rust
1
star
44

scroll-of-town-portal

Minecraft Bukkit 回城卷轴 插件
Clojure
1
star
45

dropzone

Rust
1
star
46

messager

Go
1
star
47

telegram-rss-bot

Elixir
1
star
48

dot-vimrc

自用 vim 配置,修改自 humiaozuzu/dot-vimrc
Vim Script
1
star
49

splatoon3gears2rss

JavaScript
1
star
50

OrangePiZero2ArmbianWirelessFix

How to make WiFi & Bluetooth work on Orange Pi Zero 2
1
star