{"id":20290613,"url":"https://github.com/notdodo/erfiume_bot","last_synced_at":"2025-04-11T11:00:25.579Z","repository":{"id":258104922,"uuid":"860444301","full_name":"notdodo/erfiume_bot","owner":"notdodo","description":"Bot per leggere i livelli idrometrici dei fiumi dell'Emilia Romagna riportati da allertameteo.regione.emilia-romagna.it.","archived":false,"fork":false,"pushed_at":"2025-04-09T14:15:04.000Z","size":1632,"stargazers_count":10,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T15:25:20.555Z","etag":null,"topics":["emilia-romagna","livello-fiumi","pulumi","rust","telegram"],"latest_commit_sha":null,"homepage":"https://t.me/erfiume_bot","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/notdodo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":"d0d0","thanks_dev":null,"custom":null}},"created_at":"2024-09-20T12:54:52.000Z","updated_at":"2025-04-09T14:15:06.000Z","dependencies_parsed_at":"2024-11-22T23:19:11.203Z","dependency_job_id":"65ab9b07-2268-4bd8-a454-f042de2e7954","html_url":"https://github.com/notdodo/erfiume_bot","commit_stats":null,"previous_names":["notdodo/erfiume_bot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notdodo%2Ferfiume_bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notdodo%2Ferfiume_bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notdodo%2Ferfiume_bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notdodo%2Ferfiume_bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/notdodo","download_url":"https://codeload.github.com/notdodo/erfiume_bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248381716,"owners_count":21094525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emilia-romagna","livello-fiumi","pulumi","rust","telegram"],"created_at":"2024-11-14T15:08:29.009Z","updated_at":"2025-04-11T11:00:25.533Z","avatar_url":"https://github.com/notdodo.png","language":"Rust","funding_links":["https://buymeacoffee.com/d0d0","https://www.buymeacoffee.com/d0d0"],"categories":[],"sub_categories":[],"readme":"# erfiume_bot \u003ca href=\"https://www.buymeacoffee.com/d0d0\" target=\"_blank\"\u003e\u003cimg src=\"https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png\" alt=\"Buy Me A Coffee\" style=\"height: 25px !important;width: 130px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;\" \u003e\u003c/a\u003e\n\n[![Pulumi Up](https://github.com/notdodo/erfiume_bot/actions/workflows/pulumi-up.yml/badge.svg)](https://github.com/notdodo/erfiume_bot/actions/workflows/pulumi-up.yml)\n[![Deploy Bot Lambda](https://github.com/notdodo/erfiume_bot/actions/workflows/bot-deploy.yml/badge.svg)](https://github.com/notdodo/erfiume_bot/actions/workflows/bot-deploy.yml)\n[![Deploy Fetcher Lambda](https://github.com/notdodo/erfiume_bot/actions/workflows/fetcher-deploy.yml/badge.svg)](https://github.com/notdodo/erfiume_bot/actions/workflows/fetcher-deploy.yml)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/58bb5033-87e0-4794-99f7-ddc1a3fd65b4\" width=\"400px\"/\u003e\n\u003c/p\u003e\n\n## Introduction\n\n[`@erfiume_bot`](https://t.me/erfiume_bot) it's a Telegram bot that fetches the water levels of the rivers in Emilia Romagna. Data is retrieved from [Allerta Meteo Emilia Romagna](https://allertameteo.regione.emilia-romagna.it/) APIs and periodically stored/updated in a DynamoDB table.\nThe bot can be used in both private or group chats, responding to specific station names or commands.\n\n![Screenshot 2024-09-25 at 09 47 02](https://github.com/user-attachments/assets/f5bc07c1-fb6c-48be-b871-a9d6dd4aae82)\n\n## Basic commands:\n\n- `/start`\n- `/info`\n- `/stazioni`\n- `/\u003cstazione_name\u003e` where `\u003cstazione_name\u003e` is one the station reported on [Livello Idrometrico](https://allertameteo.regione.emilia-romagna.it/livello-idrometrico)\n\n## Architecture\n\nThe bot consists of two main components:\n\n1. **User interaction**: the code in `./app/bot` is triggered by a Telegram webhook that starts an AWS Lambda function when a user interacts with the bot.\n2. **Stations data update**: the code in `./app/fetcher` runs on a Lambda function via an EventBridge scheduler, updating the data from the stations. This data is then used by the bot to answer to messages.\n\n![](./assets/erfiume.png)\n\n### Main technologies:\n\n- **Pulumi** for IaC\n- **AWS Lambda** for main code execution environment\n- **DynamoDB** for storing station data\n- **EventBridge Scheduler** to trigger the syncing from Allerta Meteo\n- **teloxide** to manage Telegram inputs\n- **tokio** for managing asynchronous tasks in the Lambdas\n- **Levenshtein Distance** for performing fuzzy search on station names from user input\n\n## Features\n\n### Telegram Bot (`./app/bot`)\n\nThe bot responds to Telegram messages via the main Lambda function and can:\n\n- respond to any message or command (`/`) in private chats\n- react when added to a group or supergroup\n- process any command (`/`) in group or supergroup chats\n\nWhat it cannot do:\n\n- read non-command messages in groups or supergroups\n- provide [inline support](https://telegram.org/blog/inline-bots)\n- support mentions\n\n### Data fetcher (`./app/fetcher`)\n\nThis Lambda function is scheduled to fetch data from the APIs on [Allerta Meteo Emilia Romagna](https://allertameteo.regione.emilia-romagna.it/) and update or create station data in a DynamoDB table. A station refers to a sensor placed on a bridge or river that monitors the water level.\n\nThe Lambda is scheduled to run once a day in \"normal\" mode, but in \"emergency\" mode, it can be set to update data every 20 minutes or less.\n\n## Repository Structure\n\n- **app/**: Contains the bot and fetcher code\n- **pulumi/**: IaC for the AWS infrastructure\n\n## Disclaimer\n\nThe accuracy and reliability of the data is entirely dependent on [Allerta Meteo Emilia Romagna](https://allertameteo.regione.emilia-romagna.it/). `erfiume_bot` merely collects and displays the available data from that source.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotdodo%2Ferfiume_bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotdodo%2Ferfiume_bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotdodo%2Ferfiume_bot/lists"}