GithubHelp home page GithubHelp logo

rss_fetcher's Introduction

RSS Feed Monitor and Message Dispatcher

This repository contains three Python scripts: monitor_rss.py, get_user_id.py, and push_dingding.py.

monitor_rss.py is a script that monitors specified RSS feeds for new entries and sends updates to a specified Telegram user through a bot.

get_user_id.py is a script that helps you retrieve the user ID of a Telegram user, which is necessary for monitor_rss.py to send updates to the correct person.

push_dingding.py is a script that can send messages to DingTalk (also known as DINGDING) by using DingTalk's outgoing webhooks feature.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Make sure you have installed the following Python packages:

  • telebot
  • feedparser
  • beautifulsoup4

If not, you can install them using pip:

pip install pyTelegramBotAPI feedparser beautifulsoup4

Installing

Clone this repository to your local machine:

git clone https://github.com/yourusername/rss-feed-monitor.git

Usage

get_user_id.py

Before running monitor_rss.py, you need to get the user ID of the Telegram user to whom the bot should send updates.

  1. Replace bot_token in get_user_id.py with your Telegram bot token.
bot_token = 'your-telegram-bot-token'
  1. Run get_user_id.py. It will print the user ID and the message text of every message your bot has received.
python get_user_id.py

monitor_rss.py

  1. Replace bot_token and user_id in monitor_rss.py with your Telegram bot token and the user ID you got from get_user_id.py, respectively.
bot_token = 'your-telegram-bot-token'
user_id = 'your-user-id'
  1. Replace rss_urls with the list of RSS feeds you want to monitor.
rss_urls = ['rss-feed-1', 'rss-feed-2', '...']
  1. If you want to send messages to DingTalk as well, import the send_to_dd function from push_dingding.py and call it in the send_message function.

  2. Run monitor_rss.py. It will check the RSS feeds every 5 minutes and send a Telegram message (and a DingTalk message if configured) for each new entry.

python monitor_rss.py

push_dingding.py

  1. Replace secret and access_token with your DingTalk webhook's secret and access token.
secret = "your-secret"
access_token = "your-access-token"
  1. Call send_to_dd(msg) function, where msg is the message you want to send.
send_to_dd("Hello, DingTalk!")

Tutorials

  1. Monitor Twitter RSS and send message to TG.

Contributions

  1. 鲁初雪 has originally written the push_dingding.py script. Ho Sir has modified the script to better fit into this project's structure and to improve compatibility with the existing monitor_rss.py script.

rss_fetcher's People

Contributors

hosir-web3 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.