swiftyspiffy / openweathermap-api-csharp Goto Github PK
View Code? Open in Web Editor NEWC# Library to interact with the OpenWeatherMap API. Exact same layout as the api returns in JSON.
C# Library to interact with the OpenWeatherMap API. Exact same layout as the api returns in JSON.
Make a nuget package and publish it to the nuget.org
I am honestly hoping it is just a bug in your software. I put the temp to faren. But it was saying it was 300 out. I put it to kelvin and it says the temp of outside. I live in ks and it is pretty hot out. So my thermometer told me 87. So when i discovered that faren is not faren and kelvin displays faren. I was hoping its just a bug in your software.
The response from OpenWeatherMaps includes a field that tells you something about the timezone. This is unfortunately not included in this library
System.NullReferenceException: Object Reference not set to an instance of an object at OpenWeatherAPI.Sys.cs line 21
Line 21:
if (sysData.SelectToken("type") != null)
Type = int.Parse(sysData.SelectToken("type").ToString());
Notes:
Commenting lines 19-31 on Sys.cs and Line 61 in query.cs seems to correct the problem.
sys.cs /*
public Sys(JToken sysData)
{
if (sysData.SelectToken("type") != null)
Type = int.Parse(sysData.SelectToken("type").ToString());
if (sysData.SelectToken("id") != null)
ID = int.Parse(sysData.SelectToken("id").ToString());
Message = double.Parse(sysData.SelectToken("message").ToString());
Country = sysData.SelectToken("country").ToString();
Sunrise = convertUnixToDateTime(double.Parse(sysData.SelectToken("sunrise").ToString()));
Sunset = convertUnixToDateTime(double.Parse(sysData.SelectToken("sunset").ToString()));
}
*/
query.cs //sys = new Sys(jsonData.SelectToken("sys"));
Add the daily forecast endpoint.
http://api.openweathermap.org/data/2.5/forecast?appid={key}&q={query}
Currently only the weather endpoint is supported.
http://api.openweathermap.org/data/2.5/weather?appid={_apiKey}&q={queryString}
Alterantively you could just allow the implementor to decide which endpoint to use
private Uri GenerateRequestUrl(string queryString) => new Uri($"http://api.openweathermap.org/data/2.5/{endpoint}/{query});
Somehow this code seems to use the users decimal separator (in my case a comma) and thus ignoreing the . (US & as far as i know part of the JSON's standard).
Result is wind speeds are 1000 fold of what they are in the data retrieved
"speed": 11.32 thus results in the demo printing 1132 m/s/
You can only use:
ValidRequest
Coordinates
WeatherList (is it supposed to be this? It returns nothing)
Base
Main
Visibility
Wind
Rain
Snow
Clouds
Sys
ID
Name
Cod
I looked into the package and it looks like everything needed is there for Weather but I can't use it.
Please, provide installation steps for the VS.
I'm using this library for a cross-platform scenario running, amongst others, on iOS. These platforms force you to use secure endpoints. It seems there are also https endpoints available for Open Weather Map so it would be great to have the ability to use https.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.