feat: Add QWeather (和风天气) API support for China users#147
feat: Add QWeather (和风天气) API support for China users#147ThendCN wants to merge 1 commit intok-donn:mainfrom
Conversation
Weather Underground has limited coverage in China, making it difficult for Chinese users to find local weather stations. This PR adds support for QWeather (和风天气), a popular weather data provider in China. Changes: - Add qweather-api.js with full QWeather API implementation - Support city search, current weather, 7-day forecast, hourly forecast - Support air quality and weather alerts - Add API Key configuration in settings - Use X-QW-Api-Key header for authentication - Normalize language codes (zh-CN -> zh) for QWeather compatibility Configuration: - Users need to register at https://console.qweather.com/ - Enter API Key and API Host in widget settings - Search for cities using Chinese names or pinyin Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Wow! This is amazing. Thank you for doing this! I am always looking for ways to improve this widget for more people. Despite that, I have to manage my time to support this widget. I have built it around Wunderground and want to keep it that way as long as I can. Supporting the infrastructure around two sources would go in a direction I do not want to go. I am probably not going to merge these changes into the main branch. However! I would love to distribute these changes as an additional option on the KDE Store. You are also more than welcome to distribute it yourself as this is a GPL-2.0 project. If there are any distribution options that would meet a Chinese audience better, feel free to distribute it there too! Going forward, you are welcome to incorporate further changes I make into the widget. You can even keep this pr open and keep the branch in sync if you want. When I push out changes, you can merge/rebase this fork. Feel free to reach out if there is a conflict, and I would love to help to clear it. Thanks again for your interest and I want you to know how much your interest means to me! If you are okay with me distributing the fork, let me know. Have a good day! |
Summary
Weather Underground has limited coverage in China, making it difficult for Chinese users to find local weather stations. This PR adds support for QWeather (和风天气), a popular weather data provider in China with excellent coverage of Chinese cities.
Changes
New Files
plasmoid/contents/code/qweather-api.js- Full QWeather API implementationModified Files
plasmoid/contents/ui/main.qml- Switch to QWeather APIplasmoid/contents/ui/config/ConfigStation.qml- Add API Key configuration UIplasmoid/contents/ui/lib/StationSearcher.qml- Use QWeather for city searchplasmoid/contents/ui/lib/StationMapSearcher.qml- Use QWeather for map searchplasmoid/contents/config/main.xml- Add qweatherApiKey config entryFeatures
Configuration
Users need to:
Technical Details
X-QW-Api-Keyheader for authenticationzh-CN→zh) for QWeather compatibilityScreenshots
(Weather data for 黄岛/Huangdao, which was not available on Weather Underground)
This is my first contribution. Happy to make any changes if needed!