<commit_before><?php 
$url = "https://gdata.youtube.com/feeds/api/standardfeeds/FR/most_popular?v=2&alt=json";
$result = json_decode(file_get_contents($url));

echo "<pre>";
echo($result->feed->entry[0]->title->0);
echo "</pre>";
 ?><commit_msg>Récupération des infos youtube + parsage en json<commit_after><?php 
require_once("Zend/Loader.php");

Zend_Loader::loadClass("Zend_Gdata_YouTube");
$yt = new Zend_Gdata_Youtube();
if (isset($_GET["q"]) && !empty($_GET["q"])) {
	$videoFeed = $yt->getVideoFeed("http://gdata.youtube.com/feeds/api/videos?q=hero+corp&orderby=published&max-results=10&v=2");
}else{
	$videoFeed = $yt->getVideoFeed("http://gdata.youtube.com/feeds/api/standardfeeds/most_popular?min-results=10&v=2");
}
$i = 0;
foreach ($videoFeed as $video): $thumbs = $video->getVideoThumbnails();
	$v[$i] = array(
		"title"       => $video->getVideoTitle(),
		"url"         => $video->getVideoWatchPageUrl(),
		"description" => $video->getVideoDescription(),
		"thumbnail"   => $thumbs[0]["url"]
		);
	$i++;
endforeach;

file_put_contents('youtube.json', json_encode($v));
$infos2 = json_decode(file_get_contents('youtube.json'));
echo "<pre>";
print_r($infos2);
echo "</pre>";
 ?>
{'fraction_non_alphanumeric': 0.2235294117647059, 'fraction_numerical': 0.010924369747899159, 'mean_word_length': 6.585987261146497, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 23, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3472090', 'n_tokens_mistral': 466, 'n_tokens_neox': 450, 'n_words': 59}