Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shpaker/feedforbot
Bot for forwarding updates from RSS/Atom feeds to Telegram
https://github.com/shpaker/feedforbot
bot cron python rss telegram telegram-bot
Last synced: 3 days ago
JSON representation
Bot for forwarding updates from RSS/Atom feeds to Telegram
- Host: GitHub
- URL: https://github.com/shpaker/feedforbot
- Owner: shpaker
- License: mit
- Created: 2017-01-03T14:27:06.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2024-12-29T08:50:57.000Z (11 days ago)
- Last Synced: 2024-12-30T01:14:14.149Z (10 days ago)
- Topics: bot, cron, python, rss, telegram, telegram-bot
- Language: Python
- Homepage:
- Size: 207 KB
- Stars: 52
- Watchers: 6
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
FeedForBot
==========[![PyPI](https://img.shields.io/pypi/v/feedforbot.svg)](https://pypi.python.org/pypi/feedforbot)
[![PyPI](https://img.shields.io/pypi/dm/feedforbot.svg)](https://pypi.python.org/pypi/feedforbot)
[![Docker Pulls](https://img.shields.io/docker/pulls/shpaker/feedforbot)](https://hub.docker.com/r/shpaker/feedforbot)
[![PyPI](https://img.shields.io/badge/code%20style-black-000000.svg)](href="https://github.com/psf/black)Forward links from RSS/Atom feeds to messengers
Installation
------------```commandline
pip install feedforbot -U
```Usage
-----### From code
```python
import asynciofrom feedforbot import Scheduler, TelegramBotTransport, RSSListener
def main():
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
scheduler = Scheduler(
'* * * * *',
listener=RSSListener('https://www.debian.org/News/news'),
transport=TelegramBotTransport(
token='123456789:AAAAAAAAAA-BBBB-CCCCCCCCCCCC-DDDDDD',
to='@channel',
)
)
scheduler.run()
loop.run_forever()if __name__ == '__main__':
main()
```### CLI
#### Save to file `config.yml` data
```yaml
---
cache:
type: 'files'
schedulers:
- listener:
type: 'rss'
params:
url: 'https://habr.com/ru/rss/all/all/?fl=ru'
transport:
type: 'telegram_bot'
params:
token: '123456789:AAAAAAAAAA-BBBB-CCCCCCCCCCCC-DDDDDD'
to: '@tmfeed'
template: |-
{{ TITLE }} #habr
{{ ID }}
Tags: {% for category in CATEGORIES %}{{ category }}{{ ", " if not loop.last else "" }}{% endfor %}
Author: {{ AUTHORS[0] }}
- listener:
type: 'rss'
params:
url: 'https://habr.com/ru/rss/news/?fl=ru'
transport:
type: 'telegram_bot'
params:
token: '123456789:AAAAAAAAAA-BBBB-CCCCCCCCCCCC-DDDDDD'
to: '@tmfeed'
template: |-
{{ TITLE }} #habr
{{ ID }}
Tags: {% for category in CATEGORIES %}{{ category }}{{ ", " if not loop.last else "" }}{% endfor %}
- listener:
type: 'rss'
params:
url: 'http://www.opennet.ru/opennews/opennews_all.rss'
transport:
type: 'telegram_bot'
params:
token: '123456789:AAAAAAAAAA-BBBB-CCCCCCCCCCCC-DDDDDD'
to: '@tmfeed'
disable_web_page_preview: yes
template: |-
{{ TITLE }} #opennet
{{ URL }}{{ TEXT }}
```#### Start script
```commandline
feedforbot --verbose config.yml
```### Docker
#### Docker Hub
```commandline
docker run shpaker/feedforbot --help
```#### GHCR
```commandline
docker run ghcr.io/shpaker/feedforbot --help
```