Home
Softono

Lemmy Rss Pybot

Open source Python
11
Stars
2
Forks
1
Issues
1
Watchers
1 year
Last Commit

 About Lemmy Rss Pybot

Lemmy RSS PyBot is a powerful Python bot that reads RSS feeds and posts new articles to your favorite Lemmy communities.

Platforms

Web Self-hosted

Languages

Python

Links

Need Help Installing Lemmy Rss Pybot?

We provide expert installation service for this software. Our team will install, configure, and secure Lemmy Rss Pybot on your server. plans start at just $30.

Lemmy Rss Pybot

View on GitHub

Lemmy RSS PyBot πŸ€–

Lemmy RSS PyBot Logo

Bringing the latest news to your favourite Lemmy communities!

License Python Version

πŸš€ Introduction

Lemmy RSS PyBot is a powerful Python bot that reads RSS feeds and posts new articles to your favorite Lemmy communities. Stay updated with the latest news, blogs, and articles time-efficiently! πŸ€“

✨ Features

  • πŸ“₯ Reads RSS feeds from a JSON file with associated communities.
  • πŸ“ Posts new articles to specified Lemmy communities.
  • πŸ” Filters articles based on keywords specified via arguments or a file.
  • ⏰ Checks for new articles every specified interval.
  • βš™οΈ Uses configuration files for settings and credentials.
  • πŸ“‘ Keeps a log of posted articles with rotating logs and auto-clearing mechanism.
  • πŸ› οΈ Supports command-line arguments for customization.
  • πŸ’‘ Includes comprehensive error handling and logging.

Execution Screenshot

πŸ“¦ Requirements

  • Lemmy account credentials in the .env file,
  • Access to Lemmy instance API,
  • A json file with the desired RSS links and communites with a true label to enable them.

πŸ› οΈ Installation (both locally or in Docker container)

git clone https://github.com/sv1sjp/lemmy_rss_pybot.git
cd lemmy-rss-pybot

πŸ”§ Configuration

Environment Variables

Create a .env file in the root directory and add your Lemmy credentials:

LEMMY_USERNAME=your_lemmy_username
LEMMY_PASSWORD=your_lemmy_password
LEMMY_INSTANCE_URL=https://your.lemmy.instance.url

RSS Feeds

Create a rss_feeds.json file to specify the RSS feeds and the Lemmy communities they should post to:

[
    {
        "feed_url": "https://newssite1.com/rss",
        "community": "[email protected]",
        "enabled": true
    },
    {
        "feed_url": "https://anotherexample.com/feed",
        "community": "[email protected]",
        "enabled": false
    }
]

πŸƒβ€β™‚οΈ Usage

Running Locally

Install Requirements

pip install -r requirements.txt
python lemmy_pybot.py --feeds rss_feeds.json --log lemmy_bot.log --interval 15

Examples

  1. Basic Usage:

    python lemmy_pybot.py
    
  2. Using Specific Time Interval:

    python lemmy-rss-pybot.py --feeds rss_feeds.json --log lemmy_bot.log --time 20
    
  3. Post Simultaneously to Communities (2 posts each):

    python lemmy-rss-pybot.py --feeds rss_feeds.json --log lemmy_bot.log --simultaneously 2 --interval 10
    
  4. Verbose Mode:

    python lemmy-rss-pybot.py --feeds rss_feeds.json --log lemmy_bot.log --verbose
    
  5. Keyword Filtering:

    python lemmy-rss-pybot.py --feeds rss_feeds.json --keywords "technology, Europe, science" --max_posts 5
    
  6. Keyword Filtering from File:

    python lemmy-rss-pybot.py --feeds rss_feeds.json --keywords-file keywords.txt --max_posts 5
    
  7. Keyword Filtering with Custom Keywords:

    python lemmy-rss-pybot.py --feeds rss_feeds.json --log lemmy_bot.log --keywords "Python, AI, Machine Learning" --max_posts 5 --interval 15
    
  8. Show detailed instructions:

    python lemmy-rss-pybot.py --help
    

Keywords (Optional)

You can filter articles by keywords using a file or command-line arguments.

  • Create a keywords.txt file with one keyword per line.
  • Or specify keywords via the --keywords argument.

Run with Docker Compose 🐳

The image has already been uploaded on DockerHub, however Dockerfile is available to built it by your own. In lemmy-rss-pybot folder, after configuring the required files, run:

docker-compose up -d

🎯 Contributing

Contributions are welcome! Please open an issue or submit a pull request.

πŸ“„ License

This project is licensed under the GNU Affero General Public License (AGPL) - see the LICENSE file for details.


🀝 Contributing

Contributions are welcome! Feel free to fork the repository and submit a pull request. If you encounter any issues, please open an issue on GitHub.


⚠️ Troubleshooting

  • Environment Variables Not Loaded: Ensure you have a valid .env file in the root directory.
  • Missing Dependencies: Run pip install -r requirements.txt to make sure all required packages are installed.
  • Syntax Issues in the JSON file: Check the example RSS feeds JSON file.
  • If you encounter any issues, please check the logs for more details.
tail -f lemmy_bot.log

πŸš€ Lemmy RSS PyBot – Created by Dimitris Vagiakakos @sv1sjp - TuxHouse