Coder Social home page Coder Social logo

skrapivn / news_aggregator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cdies/news_aggregator

1.0 0.0 0.0 33 KB

Интересный репозиторий для телеграмм бота. Подойдет к моему хобби когда появится свободное время

Python 98.70% Dockerfile 1.30%
ideas

news_aggregator's Introduction

https://habr.com/ru/post/689520/

агрегатор новостей

Для работы необходимо:

  1. Добавить свои значения переменных в файл config.py:

1.1 Параметры из my.telegram.org

  • api_id = <Твой api_id int>
  • api_hash = <Твой api_hash str>

1.2 Бот из @BotFather

  • bot_token = <Токен твоего бота str>

1.3 id канала, куда будут сливаться все новости

  • gazp_chat_id = <Id твоего канала c минусом в начале int>
  1. Запустить телеграм парсер telegram_parser.py, чтобы пройти аутентификацию в telethon и получить свои файлы сессии bot.session и gazp.session

Агрегатор по умолчанию парсит новости из:

телеграм каналы

RSS каналы

новостные сайты

Настройка и запуск

Фильтр по умолчанию настроен на газпром, газ и всё с этим связанное (хотя иногда проскакивают и другие новости). Добавить/убавить свои каналы или поменять фильтры для новостей можно в файле main.py

Каждый парсер написан таким образом, чтобы его можно было запустить отдельно от остальных. Это значительно упрощает процесс добавления новых источников, их лучше проверять отдельно, чтобы убедиться в работоспособности. Например, feedparser может не прочитать RSS канал и тогда его придется парсить вручную.

  • telegram_parser.py - парсер телеграм каналов
  • rss_parser.py - парсер RSS каналов
  • bcs_parser.py - кастомный парсер сайта www.bcs-express.ru
  • main.py - запускает все парсеры сразу, либо можно запустить в докере через docker-compose.yml

news_aggregator's People

Contributors

cdies avatar skrapivn avatar

Stargazers

 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.