2
Guys, I am working with youtube api and a query returns me the json below. How do I pick and print each item separately? For example I want to print each "videoId". How do I?
{
"kind": "youtube#activityListResponse",
"etag": "\"I_8xdZu766_FSaexEaDXTIfEWc0/oqpVLfMmbzY_6j3oThpHVqTWBFU\"",
"nextPageToken": "CAUQAA",
"pageInfo": {
"totalResults": 19,
"resultsPerPage": 5
},
"items": [
{
"kind": "youtube#activity",
"etag": "\"I_8xdZu766_FSaexEaDXTIfEWc0/dEwBoeecvF1DxUljodxRGtUsS_I\"",
"id": "VTE0NzQ3NDkwMDExNDAxMjU5MzQzMzU1MDQ=",
"contentDetails": {
"upload": {
"videoId": "H0fujYAi_qc"
}
}
},
{
"kind": "youtube#activity",
"etag": "\"I_8xdZu766_FSaexEaDXTIfEWc0/yZ6GjvR50A58SJxa_k7ATKpuoyY\"",
"id": "QlVMMTQ3NDc0OTAwMTE0MDEyNTkzNDMzNzc0NA==",
"contentDetails": {
"bulletin": {
"resourceId": {
"kind": "youtube#video",
"videoId": "H0fujYAi_qc"
}
}
}
},
{
"kind": "youtube#activity",
"etag": "\"I_8xdZu766_FSaexEaDXTIfEWc0/S4iTb5HgOBL_i1Wz57Yf-FT8Jn0\"",
"id": "VTE0NzQ3MjgzOTYxNDAxMjU5MzQzMzY5NzY=",
"contentDetails": {
"upload": {
"videoId": "DrAsh8EfH7I"
}
}
}
]
}
Opa cara...vlw amigo. I understood what you said and it worked. You can help me like this: now that I realize that I only want the ids that have the "contentDetails": { "upload": {. I want these dis. Can you help me?
– Thiago
@Thiago was edited after his comment.
– novic
Perfect friend! Help me...only this error appears "PHP Notice: Undefined index: upload"...but it already helps me! I’ll mark it as a sure thing, but if there’s one for that it would be very helpful.
– Thiago
@Thiago I edited to not have the message. On mobile is complicated
– novic
Perfect. It worked!!!
– Thiago