英雄联盟资料库
一个游戏资料库,查看英雄技能等等的,其实是小偷程序,目的是简化web页面,方便手机查看,英雄资料来自多玩英雄联盟资料库 效果看http://vwap.com.nu 源码说明在我的小站http://wapxz.t
一个游戏资料库,查看英雄技能等等的,其实是小偷程序,目的是简化web页面,方便手机查看,英雄资料来自多玩英雄联盟资料库 效果看http://vwap.com.nu 源码说明在我的小站http://wapxz.tk/v/download.php?id=1030
<?php header("Content-Type: text/html; charset=utf-8");date_default_timezone_set("Asia/Shanghai"); function li($p) { $l=file_get_contents("http://lol.duowan.com/s/heroes.html"); preg_match_all('!<li.*<a.*href=.*http:\/\/lol.duowan.com\/heros\/(.*)\/.*<img.*champion_icon.*src=(.*)<h3.*class=.*champion_title">(.*)<\/h3>.*<span.*class="champion_search_text">(.*)<\/span>.*<\/li>!suU',$l,$list); $ay=ceil(count($list[1])/30); if($p==NULL){$p=1;} if($p<0||$p>$ay){die('error');} $sta=30*($p-1); $end=30*$p; for($p2=$sta;$p2<$end;$p2++) {$ys=$p2%3;$m=$list[1][$p2]; if($ys==2){$hh="<hr/>";}else{$hh="| ";} if($m!=NULL) {$l2=$l2."<a href=?n=".$list[1][$p2].">".$list[3][$p2]."</a>".$hh; } } $l2=$l2."<div class='bold3'>"; for($dy=1;$dy<=$ay;$dy++) {if($dy!=$p) {$l2=$l2." <a href=".$_SERVER[' PHP _SELF']."?y=".$dy.">".$dy."</a> ";} else {$l2=$l2." ".$dy." ";} } $time=date("Y.m.d H:i"); $l2="<title>英雄联盟—资料库|WAP在线</title></head><body class='bold2'><div class='bold1'>英雄联盟—资料库</div>".$l2." [ ".$p." / ".$ay."]</div><div class='bold1'><a href='http://wapxz.tk'> 为易首页</a>.<a href='http://wapxz.tk/ly'>留言反馈 </a>.<a href='http://wapxz.tk/v/download.php?id=1030'>相关说明</a><hr/>Time: ".$time."<br/>Powered by <a href='http://wapxz.tk/'>Vst93</a></div></body></html>"; return $l2; } //尊重作者,是对我们最大的鼓励。 function gk($b) {preg_match_all('!LOL英雄联盟专区<\/a><span>><\/span><a href="http:\/\/lol.duowan.com\/s\/heroes.html">英雄资料<\/a><span>><\/span>(.*)<\/div>!suU',$b[0][0],$heroname); preg_match_all('!<p>(.*)<span>(.*)<\/span><img src="(.*)" \/><span>(.*)<\/span><img src="(.*)" \/><\/p>!suU',$b[0][0],$money); preg_match_all('!<h3>英雄标签:<\/h3>(.*)<p>(.*)<\/p>!suU',$b[0][0],$tag); preg_match_all('!<div class="sz">(.*)<\/div>!suU',$b[0][0],$dj); preg_match_all('!<ul>(.*)<\/ul>!suU',$b[0][0],$cz); $cz=str_replace("<p>","<br/>",$cz[1][1]); $cz=str_replace("<span>","",$cz); $cz=strip_tags($cz,"<br/>"); $out="<title>".$heroname[1][0]."</title></head><body><h1 class='bold1'>".$heroname[1][0]."</h1><div class='bold2'>英雄概况<hr/>国服:".$money[2][0]." / ".$money[4][0]."<br/>美服:".$money[2][1]." / ".$money[4][1]."<br/>英雄标签:".$tag[2][0]."<br/>物理攻击:".$dj[1][1]." | 法术攻击:".$dj[1][2]."<br/>生命数值:".$dj[1][0]." | 操作难度:".$dj[1][3]."<hr/>成长能力<hr/>".$cz; return $out; } function jn($b) {preg_match_all('!<li>\s*<img alt="" title="" src="(.*)"\/>(.*)<h4>(.*)<\/h4>(.*)<\/p>(.*)(<div class="sz">)?(.*)<\/div>\s*<\/li>!suU',$b[0][0],$jn); $out2="<title>英雄技能详情</title></head><body><div class='bold1'>英雄技能详情</div><b2 class='bold2'>".$jn[3][0]."<br/>".$jn[4][0]."<br/>".$jn[7][0]."<hr/>".$jn[3][1]."<br/>".$jn[4][1]."<br/>".$jn[7][1]."<hr/>".$jn[3][2]."<br/>".$jn[4][2]."<br/>".$jn[7][2]."<hr/>".$jn[3][3]."<br/>".$jn[4][3]."<br/>".$jn[7][3]."<hr/>".$jn[3][4]."<br/>".$jn[4][4]."<br/>".$jn[7][4]."</b2>"; return $out2; } //技巧 function jq($b) {preg_match_all('!<div class="f.*470">\s*<h3>(.*)<\/h3>(.*)<\/div>!suU',$b[0][0],$jq); $out3="<title>英雄技巧与提示</title></head><body><h1 class='bold1'>英雄技巧与提示</h1><div class='bold2'>".$jq[1][0].$jq[2][0]."<hr/>".$jq[1][1].$jq[2][1]."</div>"; return $out3; } $n=$_GET["n"]; $m=$_GET["m"]; $y=$_GET["y"]; $head='<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><style type="text/css">'; $css1='.bold1 {background-color:#303030;color:#fff;margin:0px;padding:3px;} .bold2 {background-color:#C8C8C8;color:#000;} .bold3 {background-color:#A8A8A8;color:#000;} .bold2 a:link{color:#EE2020;} .bold1 a:link{color:#5060FE;} .bold3 a:link{color:#6080EE;} </style>'; $foot="<div class='bold1'><a href=".$_SERVER[' PHP _SELF']."?n=>列表</a>.<a href=".$_SERVER[' PHP _SELF']."?n=".$n."&m=0>概况</a>.<a href=".$_SERVER[' PHP _SELF']."?n=".$n."&m=1>技能</a>.<a href=".$_SERVER[' PHP _SELF']."?n=".$n."&m=2>提示</a></div></body></html>"; $url="http://lol.duowan.com/heros/".$n."/"; curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // 指定代理地址 curl_setopt($ch, CURLOPT_PROXY, '202.108.50.72:80'); $a = curl_exec($ch); curl_close ($ch);**/ $a=file_get_contents($url); $d1='!您的当前位置(.*)<div id="foot-nav">!su'; preg_match_all($d1,$a,$b); //preg_match_all($d2,$b[0][0],$b2); if($n==NULL) {$body=li($y);} else {if($m==1){$body=jn($b);} elseif($m==2){$body=jq($b);} else{$body=gk($b);} } echo $head.$css1.$body; if($n!=Null) {echo $foot;} ?>
- 上一篇:php5类的类型提示
- 下一篇:使用 PHP 限制下载速度
精彩图集
精彩文章