no idea what this was for, or why its in an html file format when its clearly php....



generateRandomString(3); $url = "https://www.googleapis.com/youtube/v3/search?key=" . self::API_KEY . "&maxResults=$count&part=snippet&type=video&q=" . $q; $JSON = file_get_contents($url); $JSON_Data_search = json_decode($JSON); foreach ($JSON_Data_search->{"items"} as $result) { $videoId = ($result->{"id"}->{"videoId"}); /*Insert video to your database*/ } } function generateRandomString($length = 10) { return substr(str_shuffle(str_repeat($x = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', ceil($length / strlen($x)))), 1, $length); } ?>