Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #28848 > unrolled thread
| Started by | mikael.taieb@gmail.com |
|---|---|
| First post | 2015-10-21 02:52 -0700 |
| Last post | 2015-10-21 18:21 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.javascript
JSON parsing mikael.taieb@gmail.com - 2015-10-21 02:52 -0700
Re: JSON parsing Stefan Weiss <krewecherl@gmail.com> - 2015-10-21 18:21 +0200
| From | mikael.taieb@gmail.com |
|---|---|
| Date | 2015-10-21 02:52 -0700 |
| Subject | JSON parsing |
| Message-ID | <42bd1b82-7c07-48c5-bedd-5a8133f31fbd@googlegroups.com> |
Hey all, i have ZERO knowledge in javascript nor in any computer language.
I hope it's the right forum to ask this:
I have found an API online with this following JSON data :
{"Altimeter": "1025", "Cloud-List": [["SCT", "017"], ["BKN", "028"], ["BKN", "064"]], "Dewpoint": "09", "Flight-Rules": "MVFR", "Other-List": [], "Raw-Report": "LFPO 201630Z 01005KT 340V040 9999 SCT017 BKN028 BKN064 12/09 Q1025 NOSIG", "Remarks": "NOSIG", "Remarks-Info": {}, "Runway-Vis-List": [], "Station": "LFPO", "Temperature": "12", "Time": "201630Z", "Units": {"Altimeter": "hPa", "Altitude": "ft", "Temperature": "C", "Visibility": "m", "Wind-Speed": "kt"}, "Visibility": "9999", "Wind-Direction": "010", "Wind-Gust": "", "Wind-Speed": "05", "Wind-Variable-Dir": ["340", "040"]}
I'm using an android application (Tasker) to get an HTTPGet to retrieve this,
and now i'm trying to use the data through Tasker's JavaScriptlet.
I've been able to get the JSON data without any problem for stuff like Wind-Speed with a
var metar =
JSON.parse(global("HTTPD"));
setGlobal("%MetarWindSpeed",metar['Wind-Speed']);
however i have no idea how to get the "Cloud-List" into a tasker variable...
I don't mind if i have to get all the Cloud-List data in one shot or if i have to specify the type of cloud list i want (SCT, BKN, OVC...).
Any help ?
Thank you!
[toc] | [next] | [standalone]
| From | Stefan Weiss <krewecherl@gmail.com> |
|---|---|
| Date | 2015-10-21 18:21 +0200 |
| Message-ID | <n08e37$1da$1@news.albasani.net> |
| In reply to | #28848 |
On 2015-10-21 11:52, mikael.taieb@gmail.com wrote:
> I'm using an android application (Tasker) to get an HTTPGet to retrieve this,
> and now i'm trying to use the data through Tasker's JavaScriptlet.
>
> I've been able to get the JSON data without any problem for stuff like Wind-Speed with a
>
> var metar =
> JSON.parse(global("HTTPD"));
At this point, JSON parsing is done. Everything else depends on what you
want to achieve and how Tasker handles its "variables". You'll probably
have better luck asking on the Tasker forum.
- stefan
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.javascript
csiph-web