I'm pulling my hair out a bit at the moment. I can't seem to figure out how to access the "media" content within the following json object using Jade.
{
"summary":"Jose Mourinho names his Real Madrid side to face Borussia Dortmund in the Champions League semi-final 24 hours early.",
"type":"STY",
"lastUpdated":"2013-04-23T16:31:39+00:00",
"firstCreated":"2013-04-23T16:31:39+00:00",
"hasShortForm":true,
"media":{
"images":{
"index":{
"67193384":{
"height":261,
"width":464,
"href":"http://thesun.co.uk/media/images/67193000/jpg/_67193384_67193383.jpg",
"altText":"Jose Mourinho"
}
}
}
},
},
I can access summary, type, updated etc. But i cannot figure out how to access the image meta data within media.images.index.67193384
for item in results
p #{item.summary}
p #{item.lastUpdated}
p #{item.media[0]} // ???
Can someone please help me figure out? I've never tried to access data that's an object within an object within an object. Also, the 67193384 object within images.index is unique and will always be different from result to result.
Thanks!