Json parser?
I am receiving over udp an osc message with a json string:
{
"uniqueID": string,
"number": string
"name": string
"listName": string
"type": string
"colorName": string
"flagged": number
"armed": number
"cues": [ { }, { }, { } ]
}
Is there an abstraction or anything that will parse this? The keys will be static if that helps.
Thanks
GW
You might have some chances with dict.deserialize.
This just came up here:
https://cycling74.com/forums/streaming-json-data-into-max/
This is almost ok:
dict.deserialize followed by dict.itter did the job!
Thanks
GW
How so? I have a similar JSON string and can't figure out how to parse it with dict.deserialize and dict.itter. Maybe I am just too tired to figure it out. Please post a patch if you don't mind.
another option would be to do the parsing in JavaScript directly using JSON.parse(your-json-string)
Hi folks, hope it's not frowned upon here to revive a thread...
I seem to be having the same issue as bpcook and I was wondering if/how you solved it?
Cheers
pc
just in case
function f (){
var str = '{ "name":"John", "age":31, "city":"New York" }';
var res = JSON.parse(str);
post( res.name + '\n' );
post( res.age + '\n' );
post( res.city + '\n' );
}