GithubHelp home page GithubHelp logo

sidbelbase / ronbupdates Goto Github PK

View Code? Open in Web Editor NEW
2.0 0.0 1.0 3.33 MB

A telegram-bot that sends Routine Of Nepal Banda updates from Twitter as they happen.

Home Page: https://t.me/updatesfromronb

Python 89.85% HTML 9.62% Shell 0.53%
telegram-bot made-in-nepal twitter-api nepali-bot telegram-api nepali routine-of-nepal-banda ronb bot python3 telegram-nepal

ronbupdates's Introduction


A telegram-bot that sends Routine Of Nepal Banda updates from twitter as they happen.

Screenshots


Overview

This is just a simple bot that has capability of sending stuffs to channel or groups or any account you like. You could use this bot to whatever stuffs you like. But as an example, I made it to work with a channel only. Setting this project was hard this time, since it involves a database. I have worked with a telegram-bot in the past but during this project, I came across several challenges like cron jobs, python wrappers, VPS servers, etc.

I tried integrating various wrappers like python-telegram-bot, aiogram, pyTelegramBotAPI, etc. But in the end, I went all-bare i.e worked from the scratch. Setting my own webhook, sending photos my own way, sending messages like I want. I have a database placed in middle so that could be used for keeping records or a vue-based news client in the future maybe. I have also posted Github-gists below for individual breaking down of these stuffs & most important part for now, the bot won't be able to reply you, because it's busy doing works appointed by me. You could fork this one and make it work like you wanted. If you find this useful, please email me or create an issue, so that I would know you liked it so much or you may just give it a star. Yes, a star would be fine. Peace!!!

Prerequisites

  • Python 3 or higher
  • Twitter Account with Developer Access
  • Telegram Account
  • SQLite / Postgres Database

Used Tools & Technologies

  • tweepy : Twitter for Python!
  • flask : Python framework for building web applications
  • postgresql : A object-relational database system
  • sqlalchemy : SQL toolkit and object-relational mapper for Python

Environment Variables

  • TWEETARATI= 'The twitter username to get the tweets'
  • CHANNEL = 'The telegram channel you want to send updates eg. @ronbupdates'
  • SECRET_KEY = 'The secret key from flask.'
  • BOT_TOKEN = 'Bot Token generated from @botfather on telegram'
  • CONSUMER_KEY = 'Twitter's Consumer Key'
  • CONSUMER_SECRET= 'Twitter's Consumer Secret Key'
  • ACCESS_KEY = 'Twitter's Access Key'
  • ACCESS_SECRET = 'Twitter Access Secret Key'
  • DATABASE_URL = 'Database either sqlite or postgres eg: postgres://abcdef:ghijklmn@opqrstuv:5432/wxyz'

Run & Setups

Local:

flask run app.py

Production:

gunicorn -b 0.0.0.0:8000 app:app --log-level debug

Links

web > ronb.glitch.me
telegram bot > t.me/routineofnepalbot
telegram channel > t.me/updatesfromronb

Gists

fetch_tweets.py
models.py

Disclaimer

This bot or channel is not associated with either Routine of Nepal Pvt. Ltd. or ronbpost , it is only made for informational purpose on widely adopted messaging platform i.e Telegram.

Made with ❤️ in Nepal.

ronbupdates's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar imgbotapp avatar renovate-bot avatar sarojbelbase avatar

Stargazers

 avatar  avatar

Forkers

yagamipal

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.