GithubHelp home page GithubHelp logo

massimiliano76 / covid-19-telegram-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kasramp/covid-19-telegram-bot

0.0 0.0 0.0 98 KB

A Telegram bot to get latest progress on COVID-19

Home Page: https://telegram.me/covid19_update_bot

License: GNU General Public License v3.0

Shell 0.11% Java 99.89%

covid-19-telegram-bot's Introduction

COVID-19-Telegram-bot

A Telegram bot to get latest progress on COVID-19

Architecture

The project is written with on Spring Boot. No Telegram library, framework or whatsoever is used in this project. All the telegram integration is done through direct REST calls.

Data source

The @covid19_update_bot bot gets data from covid-19-api created by Muhammad Mustadi. Data is scrapped from John Hopkins University CSSE.

How to set up the project

Prerequisites

  • JDK 11

Run in local

Follow the steps to get it run in local.

Add tokens to application.properties

Set Telegram token in application.properties.

Or alternatively export them as environment variable. For example,

$ export TELEGRAM_TOKEN=[telegram_token]

Run the application

Run the project in console,

$ ./mvnw spring-boot:run

Run Ngrok

Download Ngrok from here and run it as follow,

$ ./ngrok http 8080

Update Telegram hook

Update the bot hook using hook-update.sh.

Before running the script, export the following environment variables,

$ export URL=[ngrok_url]
$ export TOKEN=[bot_token]

And finally run the script,

$ ./hook_update.sh

Mimic production environment

To mimic the production environment, run the project with the production profile as follows,

$ ./mvnw spring-boot:run -Pproduction 

Production deployment

To deploy the project to production, ensure the following environment variable is exported,

SPRING_PROFILES_ACTIVE = production

The rest of the process is more or less similar to run the project in local.

Important notes

  • In production profile, swagger-ui is disabled.
  • Only API calls that come from Telegram servers are accepted, the rest is ignored, see SecurityConfig.java.

Support

Check my site @geekyhacker.com

Contact

License

License

COVID-19-Telegram-bot is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.

COVID-19-Telegram-bot is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. http://www.gnu.org/licenses/

Author(s):

© 2020 Kasra Madadipouya [email protected]

covid-19-telegram-bot's People

Contributors

kasramp 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.