I have parsed json data like below:
{
"results": {
"authors": [
[
{
"person": "Person1 Name",
"key": "director"
}
],
[
{
"person": "Person2 Name",
"key": "author"
},
{
"person": "Person3 Name",
"key": "author"
}
]
]
}
}
I.e. there can be several directors and several authors. I should get it as string like:
directors = "Person1 Name"
authors = "Person2 Name, Person3 Name"
Looks like I should go thru each value and check its key. But how can I do it with simplejson?
The following code works for me: