Are there any plugs ins using the Dark Sky API? (https://darksky.net/dev/)
Jeff - Could it be added to WeatherXML?
Cheers
Scott
Jeff - Could it be added to WeatherXML?
Cheers
Scott
If this is your first visit, be sure to check out the FAQ. You must register before you can post.
IMPORTANT: Your first post will be checked for appropriate content. This may take a bit of time.
Imports System.Web.Script.Serialization Dim secret_key As String = "af4f2bb899888d0db" Dim json As New JavaScriptSerializer Dim LT as string = "DarkSky Script" Dim LatLong As String = "" 'leave blank to use HS lat/long data Sub Main(ByVal Parms As Object) Try If LatLong = "" then LatLong = Convert.ToDecimal(hs.getinisetting("Settings","gLatitude","37.8267")) & "," & Convert.ToDecimal(hs.getinisetting("Settings","gLongitude","-122.4233") * -1) Dim DataRaw As String = hs.GetURL("https://api.darksky.net/", "forecast/" & secret_key & "/" & LatLong, true, 80) Dim DSData As rdata = json.Deserialize(Of rdata)(DataRaw) hs.writelog(LT, "Current Summary: " & DSData.currently.summary) hs.writelog(LT, "Current Temperature: " & DSData.currently.temperature) hs.writelog(LT, "Current Humidity: " & DSData.currently.humidity) hs.writelog(LT, "Current Visibility: " & DSData.currently.visibility) Catch ex As Exception hs.writelog(LT, "Exception: " & ex.message.tostring) End Try End Sub Public Class rdata Public Property latitude As double Public Property longitude As double Public Property currently As currentdata End Class Public Class currentdata Public Property time As String Public Property summary As String Public Property icon As String Public Property nearestStormDistance As integer Public Property nearestStormBearing As integer Public Property precipIntensity As integer Public Property precipProbability As integer Public Property temperature As decimal Public Property apparentTemperature As decimal Public Property dewPoint As decimal Public Property humidity As decimal Public Property windSpeed As decimal Public Property windBearing As decimal Public Property visibility As decimal Public Property cloudCover As decimal Public Property pressure As decimal Public Property ozone As decimal End Class
Comment