DarkSky end of life next january - How to replace
Michel Angelo
michel_angelo at me.com
Tue Oct 4 04:24:23 EDT 2022
Hello. Le 2 oct. 2022 à 17:02, Philippe SCHMUCK <philippe-schmuck at orange.fr> a écrit :
> Some additional information I did not see before for Visualcrossing to get the best weather station near your location, enter the following URL:
> https://www.visualcrossing.com/weather-history <https://www.visualcrossing.com/weather-history>
> It will show you a list of the nearest weather station (airports, etc.).
> Pic the ID you’re interested in and put it in the URL
> https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/WEATHER <https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/WEATHER>_STATION_ID/today?include=fcst%2Cobs%2Chistfcst%2Cstats%2Cdays&key=YOURAPIKEY&contentType=json <https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/YOURLOCATION/today?include=fcst%2Cobs%2Chistfcst%2Cstats%2Cdays&key=YOURAPIKEY&contentType=json>
VisualCrossing seems to genuinely want to replace Darksky, including for non-paying customers. Problem is I find it difficult to get it to work for xTension.
Issue 1:
I got the "curl: (60) SSL Certificate problem: certificate has expired"
This problem is exclusive of Visualcrossing: I did not have to face it with DarkSky.
I temporarily got rid of this problem by turning off curl's verification of the certificate.
I replaced "curl " by "curl -k , which triggers the insecure version. This stopped the symptom of the problem but did not cure the problem; I will need to resolve that in the future, after having got a success on the script. . "
Issue 2:
"json exception lexical error: invalid char in json text. "
the script I try to get to work is (key edited)
<script>
try
with timeout of 20 seconds
set P_URL to "curl -k " & quote & "https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/D3549/today?include=fcst%2Cobs%2Chistfcst%2Cstats%2Cdays&key=[myKey]]&contentType=json" & quote
set P_text to do shell script P_URL
end timeout
on error errMsg number errNum
write log "Script Visualcrossing - Curl - Error Num : " & errNum & " - Error Msg : " & errMsg
end try
try
set myRecord to parse json P_text
on error
write log "Script Visualcrossing - There was an error parsing the JSON data!"
return
end try
set thedailyTendency to xdescription of myRecord
write log "Script Visualcrossing - thedailyTendency : " & thedailyTendency
<end script>
What could be wrong (which invalid character in jsom text ?)
Thanks in advance.
—
Michel Angelo
<michel_angelo at me.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.machomeautomation.com/pipermail/xtensionlist/attachments/20221004/de831edd/attachment.html>
More information about the XTensionList
mailing list