亲情奉献,送给小新

来源:互联网 发布:淘宝店名起名大全2016 编辑:程序博客网 时间:2024/04/30 15:27

一直以为我是一个大公无私的人,但当看到这两个蛋挞,我纵容了,为了表达我出卖良心的不安与躁动,证明我仍然是个大公无私的人,特意前来分享一篇小偷程序,

送给从头新到尾的能举一反三的小新们

抢劫对象:优酷

不做马后炮:我们的存在是为了让优酷大哥跑的更快,最起码在写完这个的未知天数里,优酷大哥就有反应了,醉过才知酒浓,爱过才知情深,用过才知真TMD的贱


上代码:

<?php$temp='http://www.soku.com/search_video/q_%E6%84%9F%E4%BA%BA%E5%B9%BF%E5%91%8A_orderby_1_page_1';if(!isset($_GET['url'])){$url=$temp.'1';$_GET['url']=1;}else{$url=$temp.$_GET['url'];}$result=get_all_url($url);if($result){$id=$_GET['url']+1;if($id<101){echo "<script>location.href='index.php?url=".$id."'</script>";}else{echo 'ok';}}//根据搜酷返回结果获取视频页面地址function get_all_url($url){$all_title=array();$all_url=array();$real_url=array();$content=file_get_contents($url);$pattern='/<a title="(.*)" target="_blank" href="(.*)"  _log_type="3" _log_pos="(.*)"  _log_vid="(.*)"  _log_cid="(.*)"><\/a>/';if(preg_match_all($pattern,$content,$matches[0])){$all_title=$matches[0][1];$all_url=$matches[0][2];}else{return false;}foreach($all_url as $value){$real_url[]=get_single_url($value);}$images=get_all_images($url);return insert($all_title,$real_url,$images);}//根据搜酷返回结果获取视频小图片function get_all_images($url){$content=file_get_contents($url);$pattern='/<img alt="(.*)" src="(.*)" onerror="(.*)">/';$result=array();if(preg_match_all($pattern,$content,$matches[0])){$result=$matches[0][2];}return $result;}function get_single_url($url){//根据页面地址获取真实播放地址$real_videos=array();$content=file_get_contents($url);$pattern='/<div class="item"><span class="label">flash地址: <\/span> <input type="text" class="form_input form_input_s" id="link2" value="(.*)" >/';if(preg_match($pattern,$content,$matches[0])){$real_videos[]=$matches[0][1];}else{return false;}foreach($real_videos as $value){return $value;}}//输出显示视频function display($titles,$reals){foreach($reals as $key=>$value){echo '<h3>'.$titles[$key].'</h3>';echo '<embed src="'.$value.'" allowFullScreen="true" quality="high" width="480" height="400" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash"></embed>';echo '<br /><br />';}}//视频信息入库function insert($titles,$reals,$images){mysql_connect('localhost','root','');mysql_select_db('shizheshuo');foreach($reals as $key=>$value){$sql="insert into ad_emotion(title,url,pic_url) values('{$titles[$key]}','{$value}','{$images[$key]}')";mysql_query('set names utf8');mysql_query($sql);}mysql_close();return true;}

从容不解释,只为交流和开心



个人记录,仅供参考,没有最好,只有更好,欢迎拍砖,砸鸡蛋,多交流

原创粉丝点击