Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Brawl345/rssbot
RSS Bot for the Telegram Messenger
https://github.com/Brawl345/rssbot
golang rss telegram-bot
Last synced: 3 months ago
JSON representation
RSS Bot for the Telegram Messenger
- Host: GitHub
- URL: https://github.com/Brawl345/rssbot
- Owner: Brawl345
- License: unlicense
- Created: 2022-03-07T13:21:41.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-19T12:57:52.000Z (7 months ago)
- Last Synced: 2024-06-20T16:44:14.505Z (5 months ago)
- Topics: golang, rss, telegram-bot
- Language: Go
- Homepage:
- Size: 170 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# RSS Bot for Telegram
RSS Bot for Telegram written in Go. Uses a MySQL database to store the latest entries.
Only one user (the "admin") can manage the bot, but it's possible to let the bot post into channels.
The bot's language is German, but it should be self-explanatory.
## Features
* Checks feeds every minute (after all checks are finished)
* Concurrent checks
* Can post private, in channels or groups
* Custom post format with a `post.gohtml` file
* Supports "replacements" where specific words will be removed (limited Regex is also supported). This is useful for spam like "Read more on XYZ" and stuff## Usage
1. Download binary for your system from Releases or build it yourself
2. Copy ".env.example" to ".env" and fill it in
3. (Optional) Create a `post.gohtml` with a custom Go HTML template that will be used for posts (see below)
4. Run and done! Database migrations are applied automatically.Feeds are checked every minute after the latest check finished (it waits for five seconds the first time after the bot starts).
### Use your own template
The bot reads the `post.gohtml` from the same directory and uses it as a [Go template](https://pkg.go.dev/text/template) where it inserts the data. Take a look inside the [handler/feed_check.go](handler/feed_check.go) file (the `TemplateData` struct) to see all available fields. You can find the default template inside the [config/config.go](config/config.go) file. [Limited HTML](https://core.telegram.org/bots/api#html-style) is supported and all fields are sanitized with HTML tags removed and "replacements" applied.
Example:
```gohtml
[#RSS] {{.Title}}
{{.FeedTitle}}
{{- if ne .Content "" }}
{{.Content}}
{{- end }}
{{.PostDomain}}
```