jcheng31 / DarkSkyApi

An unofficial C# library for the Dark Sky weather service. Targets .NET Standard 1.1.
MIT License
32 stars 18 forks source link

Working with the result. #7

Open kruug opened 9 years ago

kruug commented 9 years ago

How would one work with the result object to get data out?

trimzulu commented 9 years ago

You need to add the ForecastIOPortable.Models namespace to your project in order to use the Forecast class.

kruug commented 9 years ago

Right, I get that. I'm asking more about how to get the data out. Like, there's a screenshot that shows a partial glimpse at what's available, but nothing more than that.

trimzulu commented 9 years ago

Sorry if this isn't helpful but unfortunately the author seems to offer little in the way of documentation.

The best I can say is in his readme he references translating the JSON fields documented on the forecast.io website to more .NET convention-friendly names. An example was precipIntensityMax VS MaxPrecipitationIntensity.

Forecast.io themselves do have very nice documentation that you can check here: https://developer.forecast.io/docs/v2

Again, I apologize if this isn't anything you don't already know.

jcheng31 commented 9 years ago

Yeah, the documentation is pretty bad (read: non-existent) right now - sorry! I'll get something more concrete up soon. For now, the forecast.io documentation is your best bet, since the library was designed to be a one-to-one mapping to the raw API results just with the fields renamed.

In summary, though: the main result object contains current weather conditions (Currently property, shown in the README), minute-by-minute conditions for the next hour (Minutely property), hour-by-hour for the next two days (Hourly property), and day-by-day for the next week (Daily property). The actual data points in Minutely, Hourly, and Daily are retrievable from an IList (Minutes, Hours, or Days, respectively).

You can also open up the source for the various classes in the Models namespace - there are comments on each property explaining what they are, and the DataMember attributes give the name of the JSON field they correspond to.

Hope this helps for now. I'll try get something up over the weekend.

aaronhoffman commented 8 years ago

link to current documentation https://developer.forecast.io/docs/v2