<!DOCTYPE html>
<html lang="az-AZ">
<head>
<title>Esas sehife || Youtube Mp3</title>
<meta name="viewport" content="width=width-device, initial-scale=1.0">
</head>
<body>
<form method="GET" action="/s"><input type="text" name="q" value="Bir sey Axtar"><input type="submit" value="Axtar"></form>
<?php
$key ="archived"; //our key for youtube
$q=$_GET["q"];
$page=1;
$max=11;
$link =file_get_contents("
https://www.googleapis.com/youtube/v3/search?part=snippet&q=".$q."&maxResults=".$max."&pageToken=".$page."&key=".$key."");
$ok=json_decode($link);
if(!isset($_GET["page"])){
$page=$_GET["page"];
}
foreach($ok->items as $n){
//echo "<pre>";
//print_r($n);
echo $n->snippet->title."<br>";
echo "<iframe src=\"
https://youtube.com/embed/".$n->id->videoId."\"></iframe><br>Tarix: ".date("Y-M-D H:i:s",strtotime($n->snippet->publishedAt))."<hr>";
if(isset($n->nextPageToken)){
echo "<a href=\"?page=".$n->nextPageToken."\">Sehife daha</a>";
}
if(isset($n->prevPageToken)){
echo "<a href=\"?page=".$n->prevPageToken."\">Sehife daha</a>";
}
}
?>
</body></html>
kod budur uyğunlaşdıra bilərsiniz bir zəhmət?