Coder Social home page Coder Social logo

yt_tg_bot's Introduction

Telegram bot for your youtube channel

  1. the bot creates log
  2. the bot shows subscribers and view statistic info for selected youtube channel.
  3. once every n seconds the bot check the change in the number of subscribers and sends a notification to the designated contacts if the numbers have changed

build on heroku and use postgres

day stat

week stat

month stat

don't forget to create tables and specify your config vars on Heroku

variable name type description
CHANNEL_NAME str name of the channel and table to store data in database
DATABASE_URL str connection string for your database
PROJECT_NAME str just name of your project. use to make heroku web hook
TELEGRAM_TOKEN str create your bot and get the token here
YOUTUBE_TOKEN str your token more info
DELAY int sleep time (seconds)

for local use, create config.py with environ variables

import os

os.environ['CHANNEL_NAME'] = 'name of the channel and database you create'
os.environ['DATABASE_URL'] = 'con. string'
os.environ['PROJECT_NAME'] = 'bot name'
os.environ['TELEGRAM_TOKEN'] = '<your token>'
os.environ['YOUTUBE_TOKEN'] = '<your token>'
os.environ['DELAY'] = 900 # sleep time

Telegram bot для вашего youtube канала:

  1. пишет логи
  2. возвращать по запросу количество просмотров и подписчиков канала на youtube.com
  3. раз в n секунд проверять изменение количества подписчиков и отправляет уведомление обозначенным контактам если цифры изменились

Настроен на работу с сервисом heroku и базой данных posgressql.

day stat

week stat

month stat

Не забудь создать нужные таблицы и прописать переменные окружения в Heroku

variable name type description
CHANNEL_NAME str name of the channel and table to store data in database
DATABASE_URL str connection string for your database
PROJECT_NAME str just name of your project. use to make heroku web hook
TELEGRAM_TOKEN str create your bot and get the token here
YOUTUBE_TOKEN str your token more info
DELAY int sleep time (seconds)

Для локального исполнения, создай файл config.py с переменными окружения

import os

os.environ['CHANNEL_NAME'] = 'name of the channel and database you create'
os.environ['DATABASE_URL'] = 'con. string'
os.environ['PROJECT_NAME'] = 'bot name'
os.environ['TELEGRAM_TOKEN'] = '<your token>'
os.environ['YOUTUBE_TOKEN'] = '<your token>'
os.environ['DELAY'] = 900 # sleep time

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.