jcheng31 / darkskyapi Goto Github PK
View Code? Open in Web Editor NEWAn unofficial C# library for the Dark Sky weather service. Targets .NET Standard 1.1.
License: MIT License
An unofficial C# library for the Dark Sky weather service. Targets .NET Standard 1.1.
License: MIT License
Apple has purchased Dark Sky and is shutting down the API.
The API will continue to function through the end of 2021.
More Informations
Hello,
We are using your nuget package to consume DarkSkyApi.
We have this code :
var client = new DarkSkyService(apiKey);
Task taskWeatherData = client.GetWeatherDataAsync(latitudeAsDouble, longitudeAsDouble, Unit.CA, extendList, exclusionList, Language.French);
taskWeatherData.Wait();
var forecastWeather = taskWeatherData.Result;
Since few days we have an exception on Wait procedure. (HttpRequestException, WebException, IOException, SocketException).
We have tried with several apiKy and Several latitude and longitude.
The URL : https://api.darksky.net/forecast/b26c2949a2e9ffa9cfaa62183ed2c0c7/48.5586242184,2.43753236038 is working fine.
Do you have any explanation about that problem?
Thank you for your help.
Using this library in a Windows 10 app which compiles against the .NET Native toolchain, I'm getting an InvalidDataContractException in ForecastApi.ParseForecastFromResponse
when the call to serializer.ReadObject
is being made:
Type 'ForecastIOPortable.Models.Forecast' cannot be serialized, serialization code for the type is missing. Consult the SDK documentation for adding it as a root serialization type.
I've tried adding various runtime directives but so far none of them have worked. Adding @MattWhilden on the .NET Native team to take a look.
There seems to be a problem retrieving weather data for international locations using this library. When I use this code:
var fc = new ForecastIOPortable.ForecastApi(<API key>
);
Forecast ForecastData = await fc.GetWeatherDataAsync(latitude, longitude,units,ForecastIOPortable.Language.English);
That code works perfectly fine for US, UK, etc locations, but when I try a place like Mumbai, India, I get the exception mentioned above.
Exception Details:
There was an error deserializing the object of type ForecastIOPortable.Models.Forecast. Input string was not in a correct format.
Note that this is just came up in the 1.5 release of my extremely popular WP weather app Atmosphere. Can you please look into this issue ASAP before I lose more international users?
Hello,
It seems that the uvIndex and uvIndexTime information is missing on Data Point Object.
I've seen that the property is available when I make an HTTP request from a browser.
Is there an option that allows you to use Celsius instead of Fahrenheit like the website?
I could use a regex and then convert it, however it there was more than one set of numbers in the Daily Summary, I could create issues.
I've come across an annoying deadlock issue when using the library in an ASP.NET request context (this could apply to any UI context too). The issue is that the HttpClient
method GetAsync
is deadlocking.
Ref. article: Don't Block on Async Code
To fix the issue I can to call ConfigureAwait(false)
after the call to GetAsync, which stopped the deadlocking. According to Stephen Cleary, this is recommended anyway (see article above).
After calling GetWeatherDataAsync for example, what property can we check to see if Dark Sky rejected the request because the account was locked out (limit exceeded) for example.
Italian, Polish, Pig Latin, Portuguese, and Bosnian are now supported by Forecast. These should be added to the Languages enum.
First off, thanks for creating this library! Super useful.
When I upgraded my Windows 8.1 app to a Windows 10 universal app I got the following error when trying to add your NuGet package:
Not compatible with UAP,Version=v10.0 (win10-x64-aot)
Hi
I've faced with problem with decimal separator in czech locale - it is a "," but not "."
So, as result, "https://api.forecast.io/forecast/{0}/{1},{2}?units={3}&extend={4}&exclude={5}&lang={6}" will be formatted as "https://api.forecast.io/forecast/APIKEY/50,029,14,49?units=....."
workaround for now:
CultureInfo ci = Thread.CurrentThread.CurrentCulture;
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
_forecast = await _forecastClient.GetWeatherDataAsync(_lat, _longt, units, language);
Thread.CurrentThread.CurrentCulture = ci;
Regards
Dmitry Belov
Trying to Install in File => New Xamarin Forms App (iOS/Android/UWP) simply fails.
Thanks for the work though looks nice!
Hi - I've updated lib to version 2.3.0(Windows Phone Silverlight 8.1) and got a certification error in dev center:
Debug configuration test
FAILED
Debug configuration
•Error Found: The debug configuration test detected the following errors:◦The binary ForecastPCL.dll is built in debug mode.
•Impact if not fixed: Windows Phone Store doesn’t allow a debug version of an app.
•How to fix: Please make sure the app isn't linking to any debug versions of a framework and it is built with the release configuration with optimization enabled.
Best regards
Dmitry Belov
BK Labs
Might be a new item on the Alerts definition, but doesn't seem to be defined in the Forecast class
https://darksky.net/dev/docs#response-format
Alerts Array
The alerts array contains objects representing the severe weather warnings issued for the requested location by a governmental authority (please see our data sources page for a list of sources). Objects in the alerts array contain the following properties:
description required
A detailed description of the alert.
expires required
The UNIX time at which the alert will expire.
regions required
An array of strings representing the names of the regions covered by this weather alert.
severity required
The severity of the weather alert. Will take one of the following values: "advisory" (an individual should be aware of potentially severe weather), "watch" (an individual should prepare for potentially severe weather), or "warning" (an individual should take immediate action to protect themselves and others from potentially severe weather).
time required
The UNIX time at which the alert was issued.
title required
A brief description of the alert.
uri required
An HTTP(S) URI that one may refer to for detailed information about the alert.
Hi, I've installed via nugget into an Umbraco 7 project. However, I've received the following error:
Error CS4033 The 'await' operator can only be used within an async method. Consider marking this method with the 'async' modifier and changing its return type to 'Task'.
for line: Forecast result = await client.GetWeatherDataAsync(37.8267, -122.423);
(I am following your Quick start guide)
Any ideas how to resolve this error?
See #7 - documentation is currently non-existent.
The "uk" unit was in the old documentation. The "uk2" unit type has now replaced that in the documentation and it is technically more appropriate - as it will return nearestStormDistance
and visibility
in miles and not kilometres.
I suggest add a new enum value Unit.UK2
which returns "uk2" when invoking the ToValue
extension method.
How would one work with the result
object to get data out?
The base API now supports these (as of 8 June 2015) - this library should too.
Hello,
I sent a pull request some time ago with UV index data, but there's no new available package from Nuget.
Could you please release a new one with the update ?
Thanks.
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.