Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/openaq/telegram-pollution-bot
A telegram bot that sends you air quality data of locations or addresses
https://github.com/openaq/telegram-pollution-bot
air-pollution air-quality air-quality-data bot geocoding openaq telegram-bot
Last synced: about 2 months ago
JSON representation
A telegram bot that sends you air quality data of locations or addresses
- Host: GitHub
- URL: https://github.com/openaq/telegram-pollution-bot
- Owner: openaq
- License: mit
- Created: 2017-12-04T20:48:19.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-04T20:56:47.000Z (about 7 years ago)
- Last Synced: 2024-05-01T11:44:26.428Z (8 months ago)
- Topics: air-pollution, air-quality, air-quality-data, bot, geocoding, openaq, telegram-bot
- Language: JavaScript
- Size: 25.4 KB
- Stars: 6
- Watchers: 7
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DontPolluteMe Bot
## About
This is a Bot for the Telegram instant messaging service that sends you air quality data retrieved from openaq.org.
It answers when you send it your current location or the name of a place that you want to know about.## Get started
This bots runs in Telegram. If you just want to try it out go to https://t.me/DontPolluteMeBot.
If you want to run the bot on your own server download the code and run the `npm start` task.
You will have to set up the following environment variables to make it run properly:`APP_URL` public url where your server can be reached
`GOOGLE_GEOCODING_API_KEY` an api key for the google geocoding api (it might actually run without it but you will be restricted to a small number of calls per minute)
`TELEGRAM_TOKEN` the api token of your telegram bot.
## Tech
This bot runs as a minimalistic node.js server that receives the Telegram messages send to it as POST requests.
If a location is sent, it simply looks up the latest data for the given coordinates in a 25 km radius.
If an address is sent, it fist calls the Google Maps Geocoding API (https://developers.google.com/maps/documentation/geocoding) to get the coordinates for the address.
The bot returns only data more recent than 3 days and preferres measurements close to the given coordinates.