o = {
"photos": {
"page": 1,
"pages": 46,
"perpage": 5,
"total": "230",
"photo": [{
"id": "6643924777",
"owner": "34653895@N08",
"secret": "3b7c2f6469",
"server": "7153",
"farm": 8,
"title": "Huevos rellenos de bonito del norte Serrats",
"ispublic": 1,
"isfriend": 0,
"isfamily": 0},
{
"id": "6371789575",
"owner": "53643555@N08",
"secret": "dda25093e0",
"server": "6105",
"farm": 7,
"title": "ALBÓNDIGAS DE CARNE",
"ispublic": 1,
"isfriend": 0,
"isfamily": 0},
{
"id": "6200723807",
"owner": "17738873@N00",
"secret": "bf4fc5c84f",
"server": "6159",
"farm": 7,
"title": "albóndigas en salsa",
"ispublic": 1,
"isfriend": 0,
"isfamily": 0},
{
"id": "6201239628",
"owner": "17738873@N00",
"secret": "def72cc124",
"server": "6128",
"farm": 7,
"title": "albóndigas en salsa",
"ispublic": 1,
"isfriend": 0,
"isfamily": 0},
{
"id": "6171324677",
"owner": "34653895@N08",
"secret": "9f7a7489f5",
"server": "6161",
"farm": 7,
"title": "Pastel de patata con bonito del norte de Conservas Serrats y bechamel",
"ispublic": 1,
"isfriend": 0,
"isfamily": 0}]}
}
This is the response from a flickr API query. I am attempting to process it as follows:
for (var key in o) {
for (var key1 in o[key]) {
var current = o[key][key1].id;
console.log(key1); //returns the pages information
console.log(current); //returns null
}
}
Essentially, I need to generate image URLs in this format:
<img src="http://farm{farm-id}.staticflickr.com/{server-id}/{id}_{secret}.jpg" />