eklee.php
<?php
include("ayarlar.php");
class youTube {
function get_feed($feed){
$ch = curl_init();
$timeout = 0;
curl_setopt ($ch, CURLOPT_URL, $feed);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$xml = curl_exec($ch);
curl_close($ch);
return $xml;
}
function yt_results($xml, $howmany){
preg_match_all("/\<url\>(.+?)\<\/url\>/smi",$xml, $url);
preg_match_all("/\<description\>(.+?)\<\/descripti on\>/smi",$xml, $description);
preg_match_all("/\<title\>(.+?)\<\/title\>/smi",$x ml, $title);
preg_match_all("/\<id\>(.+?)\<\/id\>/smi",$xml, $id);
preg_match_all("/\<length_seconds\>(.+?)\<\/length _seconds\>/smi",$xml, $length_seconds);
preg_match_all("/\<rating_avg\>(.+?)\<\/rating_avg \>/smi",$xml, $rating_avg);
preg_match_all("/\<view_count\>(.+?)\<\/view_count \>/smi",$xml, $view_count);
preg_match_all("/\<video\>(.+?)\<\/video\>/smi",$x ml, $video);
preg_match_all("/\<thumbnail_url\>(.+?)\<\/thumbna il_url\>/smi",$xml, $thumb_nail);
array_shift($url);
array_shift($thumb_nail);
array_shift($description);
array_shift($title);
array_shift($id);
array_shift($length_seconds);
array_shift($rating_avg);
array_shift($view_count);
array_shift($video);
for($i=0;$i<count($description[0]);$i++){
$description[0][$i] = preg_replace("/ $description[0][$i] = htmlspecialchars_decode($description[0][$i],ENT_QUOTES);
}
for($i=0;$i<count($title[0]);$i++){
$title[0][$i] = preg_replace("/ $title[0][$i] = htmlspecialchars_decode($title[0][$i],ENT_QUOTES);
}
$total_videos = count($video[0]);
if($howmany > $total_videos){
$howmany = $total_videos;
}
if(!$howmany || $howmany == 0){
$howmany = $total_videos;
}
global $kid;
for($i = 0; $i<$howmany; $i++){
$yenimetin=str_replace($harfler,$harfler2,$title[0][$i]);
$metin=str_replace($harfler,$harfler2,$description[0][$i]);
$tarihsaat = date("Y-m-d H:i:s");
$query="insert into video values('','".$kid."','".$yenimetin."','".$metin."' ,'".$thumb_nail[0][$i]."','http://www.youtube.com/v/".$id[0][$i]."&autoplay=1','1','".$length_seconds[0][$i]."','".$tarihsaat."','0','1','0')";
mysql_query("$query");
print "".$yenimetin.";<br>";
}
}
function yt_featured($dev_id, $howmany){
$feed = "http://www.youtube.com/api2_rest?met...dev_id=$dev_id";
$xml = $this->get_feed($feed);
$this->yt_results($xml, $howmany);
}
function yt_user($dev_id, $user, $howmany){
$feed = "http://www.youtube.com/api2_rest?met..._id&user=$user";
$xml = $this->get_feed($feed);
$this->yt_results($xml, $howmany);
}
function yt_tag($dev_id, $tag, $page){
$feed = "http://www.youtube.com/api2_rest?met...g&page=$pag e";
$xml = $this->get_feed($feed);
$this->yt_results($xml, $howmany);
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Video Merkezi</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9">
</head>
<body>
<?
$sayfa = $HTTP_POST_VARS["page"];
$tagi = $HTTP_POST_VARS["tag"];
$kid = $HTTP_POST_VARS["id"];
$tag=str_replace($yeni,$eski,$tagi);
$yt = new youTube;
print "<p>Videolar: ".$kid."</p>";
for($page = 0; $page<=$sayfa; $page++){
$yt->yt_tag("OrQTXfQsgdY", $tag, $page);
}
?>
</body>
</html>dene bakalım. Bu arada
yoq diye birşey
yoktur