影视搜索php源码

流氓凡 PHP程序源码 2017-05-01 5.68 K 0

调用尘落影视网的资源,也可自行替换

源码如下:

<?php
header("Content-type: text/html; charset=utf-8");
$movie=$_GET['movie'];
date_default_timezone_set('PRC');
function posturl($url,$post){
$posturl =  $url;  
$curlPost= $post;
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);  
$data = curl_exec($ch);  curl_close($ch);
return $data;
}
$url="http://www.50s.cc/?c=search";
$post="wd=".$movie;
$get=posturl($url,$post);
$get = str_replace(array("\r\n", "\r", "\n"), "",$get);
$zz='#<a style="position:relative;display:block;" title="(.*?)" target="_blank" href="(.*?)">(.*?)<img alt="(.*?)" title="(.*?)" src="(.*?)">#';
preg_match($zz,$get,$out);
$name=$out[1];
$lj="http://www.50s.cc".$out[2];
$photo=$out[6];
echo "<?xml version='1.0' encoding='UTF-8' standalone='yes' ?><msg serviceID=\"1\" templateID=\"14\" action=\"web\" brief=\"免vip影视搜索\" flag='19' ><item layout=\"5\"><picture cover=\"".$photo."\"/></item><item layout=\"0\"><hr/><title color=\"#FF0000\" size=\"28\">片名:《".$name."》</title><hr/><title color=\"#00B2EE\" size=\"26\">提示:没找到想要的结果可以 试试直接去本站搜索!</title><hr/></item><item layout=\"3\"><button action=\"web\" url=\"".$lj."\">点击这里立即观看</button></item><source name=\"\" icon=\"\" action=\"\" appid=\"-1\" /></msg>";
?>

晨风机器人调用方式:

影视搜索*        【显示网址内容http://你的域名/xz.php?movie=$回声$】


评论