feedforbot


Namefeedforbot JSON
Version 3.3.4 PyPI version JSON
download
home_pagehttps://github.com/shpaker/feedforbot
SummaryForward links from RSS/Atom feeds to messengers
upload_time2024-11-23 10:17:32
maintainerNone
docs_urlNone
authorAleksandr Shpak
requires_python>=3.10
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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 asyncio

from 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: |-
          <b>{{ TITLE }}</b> #habr
          {{ ID }}
          <b>Tags</b>: {% for category in CATEGORIES %}{{ category }}{{ ", " if not loop.last else "" }}{% endfor %}
          <b>Author</b>: <a href="https://habr.com/users/{{ AUTHORS[0] }}">{{ AUTHORS[0] }}</a>
  - 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: |-
          <b>{{ TITLE }}</b> #habr
          {{ ID }}
          <b>Tags</b>: {% 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: |-
          <b>{{ TITLE }}</b> #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
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/shpaker/feedforbot",
    "name": "feedforbot",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "Aleksandr Shpak",
    "author_email": "shpaker@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/88/16/62cbc8e907ba943b4d764babff8552d4b4b783c8a47fbfdd722f3f84b5ae/feedforbot-3.3.4.tar.gz",
    "platform": null,
    "description": "FeedForBot\n==========\n\n[![PyPI](https://img.shields.io/pypi/v/feedforbot.svg)](https://pypi.python.org/pypi/feedforbot)\n[![PyPI](https://img.shields.io/pypi/dm/feedforbot.svg)](https://pypi.python.org/pypi/feedforbot)\n[![Docker Pulls](https://img.shields.io/docker/pulls/shpaker/feedforbot)](https://hub.docker.com/r/shpaker/feedforbot)\n[![PyPI](https://img.shields.io/badge/code%20style-black-000000.svg)](href=\"https://github.com/psf/black)\n\nForward links from RSS/Atom feeds to messengers\n\nInstallation\n------------\n\n```commandline\npip install feedforbot -U\n```\n\nUsage\n-----\n\n### From code\n\n```python\nimport asyncio\n\nfrom feedforbot import Scheduler, TelegramBotTransport, RSSListener\n\n\ndef main():\n  loop = asyncio.new_event_loop()\n  asyncio.set_event_loop(loop)\n  scheduler = Scheduler(\n    '* * * * *',\n    listener=RSSListener('https://www.debian.org/News/news'),\n    transport=TelegramBotTransport(\n      token='123456789:AAAAAAAAAA-BBBB-CCCCCCCCCCCC-DDDDDD',\n      to='@channel',\n    )\n  )\n  scheduler.run()\n  loop.run_forever()\n\nif __name__ == '__main__':\n  main()\n```\n\n### CLI\n\n#### Save to file `config.yml` data\n\n```yaml  \n---\ncache:\n  type: 'files'\nschedulers:\n  - listener:\n      type: 'rss'\n      params:\n        url: 'https://habr.com/ru/rss/all/all/?fl=ru'\n    transport:\n      type: 'telegram_bot'\n      params:\n        token: '123456789:AAAAAAAAAA-BBBB-CCCCCCCCCCCC-DDDDDD'\n        to: '@tmfeed'\n        template: |-\n          <b>{{ TITLE }}</b> #habr\n          {{ ID }}\n          <b>Tags</b>: {% for category in CATEGORIES %}{{ category }}{{ \", \" if not loop.last else \"\" }}{% endfor %}\n          <b>Author</b>: <a href=\"https://habr.com/users/{{ AUTHORS[0] }}\">{{ AUTHORS[0] }}</a>\n  - listener:\n      type: 'rss'\n      params:\n        url: 'https://habr.com/ru/rss/news/?fl=ru'\n    transport:\n      type: 'telegram_bot'\n      params:\n        token: '123456789:AAAAAAAAAA-BBBB-CCCCCCCCCCCC-DDDDDD'\n        to: '@tmfeed'\n        template: |-\n          <b>{{ TITLE }}</b> #habr\n          {{ ID }}\n          <b>Tags</b>: {% for category in CATEGORIES %}{{ category }}{{ \", \" if not loop.last else \"\" }}{% endfor %}\n  - listener:\n      type: 'rss'\n      params:\n        url: 'http://www.opennet.ru/opennews/opennews_all.rss'\n    transport:\n      type: 'telegram_bot'\n      params:\n        token: '123456789:AAAAAAAAAA-BBBB-CCCCCCCCCCCC-DDDDDD'\n        to: '@tmfeed'\n        disable_web_page_preview: yes\n        template: |-\n          <b>{{ TITLE }}</b> #opennet\n          {{ URL }}\n\n          {{ TEXT }}\n```\n\n#### Start script\n\n```commandline\nfeedforbot --verbose config.yml\n```\n\n### Docker \n\n#### Docker Hub\n\n```commandline\ndocker run shpaker/feedforbot --help\n```\n\n#### GHCR\n\n```commandline\ndocker run ghcr.io/shpaker/feedforbot --help\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Forward links from RSS/Atom feeds to messengers",
    "version": "3.3.4",
    "project_urls": {
        "Homepage": "https://github.com/shpaker/feedforbot",
        "Repository": "https://github.com/shpaker/feedforbot"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8872926a83533705c170f6e688f5d8df6b1ae0dc486b036fa4734bd609c27a7d",
                "md5": "b16c4eaa698aa24dc034bb5e876afc71",
                "sha256": "0035f56b5274371ac5e24ab25c98d8d9e03932c760d3d93f36777f9273fd6d02"
            },
            "downloads": -1,
            "filename": "feedforbot-3.3.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b16c4eaa698aa24dc034bb5e876afc71",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 12702,
            "upload_time": "2024-11-23T10:17:31",
            "upload_time_iso_8601": "2024-11-23T10:17:31.174080Z",
            "url": "https://files.pythonhosted.org/packages/88/72/926a83533705c170f6e688f5d8df6b1ae0dc486b036fa4734bd609c27a7d/feedforbot-3.3.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "881662cbc8e907ba943b4d764babff8552d4b4b783c8a47fbfdd722f3f84b5ae",
                "md5": "15eabdf0f6920f33c9f13df56fa5150d",
                "sha256": "e09bd8d674ecfaf7f7d4c0808fcfe27d2a1da1978167f75547b51130b42c2392"
            },
            "downloads": -1,
            "filename": "feedforbot-3.3.4.tar.gz",
            "has_sig": false,
            "md5_digest": "15eabdf0f6920f33c9f13df56fa5150d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 10722,
            "upload_time": "2024-11-23T10:17:32",
            "upload_time_iso_8601": "2024-11-23T10:17:32.079869Z",
            "url": "https://files.pythonhosted.org/packages/88/16/62cbc8e907ba943b4d764babff8552d4b4b783c8a47fbfdd722f3f84b5ae/feedforbot-3.3.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-23 10:17:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "shpaker",
    "github_project": "feedforbot",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "feedforbot"
}
        
Elapsed time: 0.41693s