mirror of
https://github.com/Infinitybeond1/wttrin
synced 2026-01-15 05:01:32 +00:00
No description
| src | ||
| tests | ||
| config.nims | ||
| LICENSE | ||
| README.md | ||
| wttrin.nimble | ||
wttrin
A small nim library that fetches weather from wttr.in
IMPORTANT: if you use this library in your code you will need to build your nim project with the ssl flag
nim c -r -d:ssl <filename>
Usage
getTemp()
The first (and most used) function is getTemp()
This function has an optional parameter city which should be a city in lowercase
If the city parameter isn't provided it defaults to using your current location
import wttrin
echo getTemp
getCondition()
Another function, 'getCondition()', can be used to get the weather condition as an emoji
import wttrin
echo getCondition
getUnit()
The final function, 'getUnit()', can be used to get the current unit of weather
import wttrin
echo getUnit