Skip to content

đź›° @INMETBot - Telegram bot to fetch recent satellite images and alerts. Not affiliated with INMET.

License

Notifications You must be signed in to change notification settings

AtilioA/INMETBot

Repository files navigation

@INMETBot - Bot no Telegram para solicitar imagens de satélites e alertas recentes (não filiado ao INMET).

Telegram bot to fetch satellite images and recent alerts (not affiliated to INMET).

About   |   Examples   |   Running locally

Telegram bot License: GPL v3 GitHub code size in bytes

â„ą About

Telegram bot that scrapes INMET's website/consumes its API and makes information available through a Telegram bot. It runs on Python 3 and uses MongoDB to store chat preferences. You can try it here (only available in pt-BR), or learn to run a local instance.

đź“– Examples

The screenshots are slightly outdated, but can still convey the functionality:

  • Creating GIF made of the last 10 images from the enhanced water vapor satellite:

    /nuvens command

  • Subscribing to be notified about alerts affecting subscribed CEPs (Brazilian postal code):

    /inscrever command

  • Getting the alerts map from Alert-AS:

    /mapa command

You can learn more with the /help command.

🏡 Running locally

First, clone the repository and make sure you have Docker installed. Inside the repository directory, build the local Docker image for INMETBot:

git clone https://github.com/AtilioA/INMETBot
cd INMETBot
docker build . -t inmetbot

Some of the bot's functionalities depend on being connected to a MongoDB database. If you wish to use your own database, just set the INMETBOT_MONGO_URI environment variable in the .env.example file to your URI connection string and rename the .env.example file to .env or, alternatively, set INMETBOT_MONGO_URI as an environment variable of the system hosting the bot. Using local databases have not been tested.

Finally, start the container while passing environment variables directly to Docker:

docker run -t --name inmetbot \
              -e TELEGRAM_INMETBOT_APIKEY=t.me/BotFather \
              -e INMETBOT_MONGO_URI='mongodb+srv://<user>:<password>@cluster0-fcm5r.mongodb.net/<collection>?retryWrites=true&w=majority' \
              inmetbot

Alternatively, again, you can rename .env.example to .env and fill the variables there, since they'll be copied over to the Docker container. This way, you can create the container by simply running docker run -t --name inmetbot inmetbot.

Running the bot without Docker is trickier, but possible. Create a virtual environment with Python, install dependencies with pip install -r requirements.txt and get a Selenium driver (currently using the chromedriver) set in your PATH. With everything done, you can start the bot with python main.py.

About

đź›° @INMETBot - Telegram bot to fetch recent satellite images and alerts. Not affiliated with INMET.

Topics

Resources

License

Stars

Watchers

Forks