2025-03-29 18:03:55 -04:00

77 lines
2.3 KiB
Markdown

# Weather Plugin for Limnoria
A Limnoria plugin that provides weather information using the Open-Meteo API and geolocation with Geopy.
## Features
- Get current weather conditions and forecasts
- Save locations for users
- Convert between temperature units
- Display weather for any location or your saved location
- Configurable display options
## Dependencies
This plugin depends on:
- `requests` - For making HTTP requests to the Open-Meteo API
- `geopy` - For geocoding location names to latitude/longitude
Install these with your package manager or pip:
```
pip install requests geopy
```
## Commands
### User Commands
- `.setweather <location>` - Set your location for weather lookups
- `.delweather` - Delete your saved location
- `.weather [<location>]` - Show weather for your saved location or for the specified location
### Examples
```
.setweather Salt Lake City, Utah
.setweather 07644
.setweather BLF
.weather
.weather Bluefield, WV
.weather Leichlingen
```
## Configuration
The plugin has several configuration options:
- `supybot.plugins.Weather.userAgent` - User agent for Nominatim geocoding service
- `supybot.plugins.Weather.defaultUnit` - Default temperature unit (C or F)
- `supybot.plugins.Weather.showHumidity` - Whether to show humidity in weather reports
- `supybot.plugins.Weather.showWind` - Whether to show wind speed in weather reports
- `supybot.plugins.Weather.showForecast` - Whether to show forecast in weather reports
- `supybot.plugins.Weather.forecastDays` - Number of forecast days to display
These can be set using the `.config` command, for example:
```
.config channel #channel supybot.plugins.Weather.defaultUnit F
.config channel #channel supybot.plugins.Weather.showForecast True
.config channel #channel supybot.plugins.Weather.forecastDays 3
```
## Installation
1. Copy the plugin directory to your Limnoria plugins directory
2. Load the plugin: `.load Weather`
3. Configure as needed
## Notes
- Users must be registered and identified with the bot to use the `.setweather` and `.delweather` commands
- This plugin uses the free Open-Meteo API for weather data
- Location geocoding uses OpenStreetMap's Nominatim service, so please respect their usage policy
## Privacy
This plugin stores user locations in a local database file. Users can delete their data at any time using the `.delweather` command.