I am trying to Decode json file using cache_remote_file plugin. I cant get my head round how to do this. This is my attempt and cant workout how to do this. Can please someone tell me what I am doing worng and how to it. Thank you.
Code: Select all
{capture assign=feed}{cache_remote_file url="https://www.googleapis.com/youtube/v3/videos?part=snippet%2CcontentDetails%2Cstatistics&id=Duf5UUT......"}{/capture}
{foreach from=$feed|json_decode item=data}
<p> title : {$data->items->snippet->title} </p>
<p> img : {$data->items->snippet->thumbnails->default->url} </p>
{/foreach}
Code: Select all
{
"kind": "youtube#videoListResponse",
"etag": "9ZzDWJlUMjKGsGwGvtEREF_adhk",
"items": [
{
"kind": "youtube#video",
"etag": "L3XeWemLM2vSCJh_RkWQgIjUbs4",
"id": "Duf5UUT4ESg",
"snippet": {
"publishedAt": "2021-07-21T16:39:22Z",
"channelId": "UCEUfZ0aVKoC80RIAfvTBfDw",
"title": "Sheffield Voices speaking out on issues of abuse at Firshill Sheffield",
"description": "Sheffield Voices Self Advocacy group have been shocked and upset by reports of people with learning disabilities and Autism being restrained, not being given food and water, being ignored and not being protected from violence within the Assessment and Treatment Unit and have made a video so people know how we are feeling about this",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/Duf5UUT4ESg/default.jpg",
"width": 120,
"height": 90
},
......................