sopel气象模块的工作再实现
sopel-modules.weather的Python项目详细描述
sopel天气
sopel weather是sopel的天气查找模块。
由于雅虎在2019年1月3日否决了他们的天气api,因此有必要重新实现天气模块
用法
# Allows the user to set their current location
.setlocation london # Sets location by city name
.setlocation w2643743 # Sets location by WOEID (We are prepending w in front of WOEIDs because they collide with zips)
.setlocation 98101 # Sets location by zip code
# Gets a 24h forecast
.forecast # Only works if setlocation has been previously run
.forecast seattle, us
.forecast london
# Gets the current weather
.weather # Only works if setlocation has been previously run
.weather seattle, us
.weather london
要求
API键
https://openweathermap.org/api
python需求
requests
sopel