- Notifications
You must be signed in to change notification settings - Fork14
A .NET Standard Library for using the Dark Sky API.
License
amweiss/dark-sky-core
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
ARCHIVED:Apple has purchased Dark Sky and is shutting down the API, so I'm no longer supporting this.
A .NET Standard Library for using theDark Sky API.
The main class isDarkSkyService
. When using it you will need provide your API key aftersigning up for a dev account.You can also provide an implementations ofIHttpClient
andIJsonSerializerService
if you want to replace the defaultZipHttpClient
andJsonNetJsonSerializerService
for testing or other purposes.
Once you have an instance of the class, useGetForecast
to use the API. The method by default is aforecast request.If you specify a value forForecastDateTime
in anOptionalParameters
instance it will become atime machine request.
The responses all take the form of aCamelCase version of theDark Sky Response inDarkSkyResponse
.This includes theheaders and properties for the required text and link to use based on theTerms of Service.
vardarkSky=newDarkSky.Services.DarkSkyService(apiKey);varforecast=awaitdarkSky.GetForecast(42.915,-78.741);if(forecast?.IsSuccessStatus==true){Console.WriteLine(forecast.Response.Currently.Summary);}else{Console.WriteLine("No current weather data");}Console.WriteLine(forecast.AttributionLine);Console.WriteLine(forecast.DataSource);
You can see more examples of usage in theintegration tests.
Code of Conduct andContributing Guidelines for the project.
About
A .NET Standard Library for using the Dark Sky API.
Topics
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors8
Uh oh!
There was an error while loading.Please reload this page.