Home ProgrammingC# Visual C#: Weather Gadget – WUnderK

Visual C#: Weather Gadget – WUnderK

by Kliment Andreev

Wunderground and free API keys

NOTE: Wunderground discontinued the use of free API keys so this solution won’t work anymore. There are some other sites that offer free API keys and weather services but the program will require some heavy modification in order to work.

I miss the onscreen weather gadget that was included in Windows 7, but not in Windows 10, so I made a similar application. It gets the current weather and the forecast from the Weather Underground web site. Initially I tried to use OpenWeatherMap and its API but the temperatures were off for an hour or two, meaning the current temperature that I got from the API call was the actual temperature 1-2 hours ago.
Both Weather Underground and OpenWeatherMap offer free API calls and you need to register in order to get an API key. Using that key, you can retrieve the weather. No key – no weather forecast.

So, first go to WU web site, register and get a key.
If you want to get the source, make sure that you have JSON from Netwtonsoft in your project reference. See their web page for install.

git clone https://www.github.com/klimenta/WUnderK

If you want the EXE, you’ll have to install it because the EXE comes with the Json.dll.
Download it from here.

NOTE: The WU API returns JSON which can be parsed and validated on this web site for accuracy. The output was deserialized directly to C# classes and the conversion was possible because of this site.

This is how the gadget (app) looks like expanded with the details and forecast panes. You can hide them if you want, so only the temperature and the city is shown.

This is the options screen.

And this is how it looks like on the screen.

Related Articles

Leave a Comment

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More