8000 Add proper english README by hashworks · Pull Request #90 · iovxw/rssbot · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proper english README #90

Merged
merged 2 commits into from
Jun 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 123 additions & 2 deletions README.en.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,126 @@
# rssbot [![Build Status](https://github.com/iovxw/rssbot/workflows/Rust/badge.svg)](https://github.com/iovxw/rssbot/actions?query=workflow%3ARust) [![Github All Releases](https://img.shields.io/github/downloads/iovxw/rssbot/total.svg)](https://github.com/iovxw/rssbot/releases)

**Other Languages:** [Chinese](README.md)

Chinese Telegram RSS bot [@RustRssBot](http://t.me/RustRssBot)

**Supports:**
- [x] RSS 0.9
- [x] RSS 0.91
- [x] RSS 0.92
- [x] RSS 0.93
- [x] RSS 0.94
- [x] RSS 1.0
- [x] RSS 2.0
- [x] Atom 0.3
- [x] Atom 1.0
- [x] JSON Feed 1

## WIP

English version is still work in progress.

Unresolved problems:
**Unresolved problems:**
* The command description in Telegram can't be internationalized

## Usage

/rss - Display a list of currently subscribed RSS feeds
/sub - Subscribe to an RSS: /sub http://example.com/feed.xml
/unsub - Unsubscribe from an RSS: /unsub http://example.com/feed.xml
/export - Export to OPML

## Download

The pre-compiled binaries can be downloaded directly from [Releases](https://github.com/iovxw/rssbot/releases). The Linux version is statically linked to *musl*, no other dependencies required.

## Compile

**Please try to download from the Link above, if that's not feasible or you have other requirements you should compile manually**

Install *Rust Nightly* and *Cargo* ([`rustup` recommended](https://www.rustup.rs/)) first, then:

```
cargo build --release
```

The compiled files are available at: `./target/release/rssbot`

## Run

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

FLAGS:
-h, --help Prints help information
--insecure DANGER: Insecure mode, accept invalid TLS certificates
-V, --version Prints version information

OPTIONS:
-d, --database <database> Path to database [default: ./rssbot.json]
--max-interval <max-interval> Maximum fetch interval, seconds [default: 43200]
--min-interval <min-interval> Minimum fetch interval, seconds [default: 300]

ARGS:
<token> Telegram bot token
```

Please read the [official docs](https://core.telegram.org/bots#3-how-do-i-create-a-bot) to create a token.

## Environment variables

- `HTTP_PROXY`: Proxy for HTTP
- `HTTPS_PROXY`: Proxy for HTTPS
- `RSSBOT_DONT_PROXY_FEEDS`: Set to `1` to limit the proxy to Telegram requests
- `NO_PROXY`: Not supported yet, wait for [reqwest#877](https://github.com/seanmonstar/reqwest/pull/877)

## Migrating from the old RSSBot

For the [original version of Clojure Bot ](https://github.com/iovxw/tg-rss-bot), you can use the following script to convert the database:

```bash
#!/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
```

Parameter 1 is the old database path, parameter 2 is the resulting output JSON path.

It should be noted that the RSS records that have been pushed will not be marked. If the converted database is used directly, the old RSS will be pushed repeatedly when the script is called again.

## License

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

- The command description in Telegram can't be internationalized
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.
0