1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
| <?
/*###########################################
# İzlesene.com VidiBot :|
# Betik Yazari : 0xyGen | yns |
# http://yns.linuxboyz.com
# yns@linuxboyz.com
##############################################*/
ob_start();
@error_reporting(E_ALL & ~E_NOTICE);
@ini_set('error_reporting',E_ALL & ~E_NOTICE);
require_once("config.php");
Function titleclear($title)
{
$badwords = array ('ı','Å?','ü','ç','ö','Ä?','Å?','Ã?','İ','Ä?','Åz','Ã?','Ã?','ı','Å?','ç','ö','Ä?','Å?','Ã?','İ','Ä?','Åz','Ã?','Ã?','ü','Ä?','Ä?');
$newwords = array ('ı','ş','ü','ç','ö','ğ','ş','Ç','i','ğ','Ş','Ö','Ü','ı', 'ş', 'ç', 'ö', 'ğ', 'ş', 'Ç', 'i', 'ğ', 'Ş', 'Ö', 'Ü', 'ü', 'ğ','Ğ');
$replace = str_replace($badwords, $newwords, $title);
return $replace;
}
//definations
$channels = array('gununv','15','2','5','12','populerv','10','7','18','9','yeniv','16','17','1','8','13','11','1','4');
$array_size = count($channels);
$rand_num = rand(0,$array_size);
$rss_source = "http://rss.izlesene.com/rss.php?type=".$channels[$rand_num].""; // rss website
$file = dirname(__FILE__)."/data.xml"; // rss data file
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$rss_source);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch , CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)");
$okay = curl_exec($ch);
curl_close($ch);
$okay = str_replace(";","",$okay);
$okay = str_replace("&","",$okay);
$okay = str_replace("^"," ",$okay);
$date = date("d_m_y_h_i_s");
//create data.xml File
if(!file_exists($file))
{
$touch = @touch($file);
chmod($file,0777);
if($touch)
{
echo "Data XML File Created !";
}
else
{
echo "Data XML File NOT CREATED. Please Create ".$file." and CHMOD 777";
exit;
}
}
$fp = @fopen($file,'w');
fwrite($fp,$okay);
fclose($fp);
$data = simplexml_load_file($file);
$num = count($data->channel[0]->item);
for($i=0; $i<=$num-1;$i++)
{
$video = $data->channel[0]->item[$i]->description;
$title = $data->channel[0]->item[$i]->title;
preg_match('/<a href=\"(.*?)\">/i',$video,$vid_id);
preg_match('/src=\"(.*?)\"/i',$video,$thumb);
preg_match('/Etiketler:(.*?)<br\/>/i',$video,$tags);
$vid_id = explode("/",$vid_id[1]);
/*
$img = explode("/",$thumb[1]);
$totalslash = count($img)-1;
$imgname = $img[$totalslash]; // resim adi
*/
$check = mysql_query("SELECT vid_id FROM videos WHERE vid_id='".$vid_id[5]."'");
if(mysql_num_rows($check) < 1)
{
$embed = "<div style=\"width:465px;\"><embed src=\"http://www.izlesene.com/player2.swf?video=".$vid_id[5]."\" wmode=\"window\" bgcolor=\"#000000\" allowfullscreen=\"true\" scale=\"noScale\" width=\"100%\" height=\"355\" type=\"application/x-shockwave-flash\"></embed></div>";
$title = titleclear($title);
$img = $thumb[1];
$tags = titleclear($tags[1]);
mysql_query("INSERT INTO videos VALUES('NULL','".$title."','".$embed."','".$img."','".$tags."','".$vid_id[5]."')");
}
}
?> |