Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Apr 1, 2020. It is now read-only.
/dark-sky-corePublic archive

A .NET Standard Library for using the Dark Sky API.

License

NotificationsYou must be signed in to change notification settings

amweiss/dark-sky-core

Dark Sky Core

NuGetBuild Statuscodecov

A .NET Standard Library for using theDark Sky API.

Usage

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 andJsonNetJsonSerializerServicefor 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.

Additional Information

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

Stars

Watchers

Forks

Packages

No packages published

Contributors8

Languages


[8]ページ先頭

©2009-2025 Movatter.jp