<?
error_reporting(0);
header('Content-Type: text/html; charset=gbk');
function openu($url)
{
$url = eregi_replace('^http://', '', $url);
$temp = explode('/', $url);
$host = array_shift($temp);
$path = '/'.implode('/', $temp);
$temp = explode(':', $host);
$host = $temp[0];
$port = isset($temp[1]) ? $temp[1] : 80;
$fp = @fsockopen($host, $port, &$errno, &$errstr, 30);
if ($fp)
{
@fputs($fp, "GET $path HTTP/1.1\r\n");
@fputs($fp, "Host: $host\r\n");
@fputs($fp, "Accept: */*\r\n");
@fputs($fp, "Referer: http://$host/\r\n");
@fputs($fp, "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)\r\n");
@fputs($fp, "Connection: Close\r\n\r\n");
}
$Content = '';
while ($str = @fread($fp, 4096))
$Content .= $str;
@fclose($fp);
return $Content;
}
function arrContentReplact($array)
{
if(is_array($array))
{
foreach($array as $k => $v)
{
$array[$k] = arrContentReplact($array[$k]);
}
}else
{
$array = str_replace(array('<![CDATA[', ']]>'), array('', ''), $array);
}
return $array;
}
if($_GET['act']=='seek'){
$qqurl='http://qzone-music.qq.com/fcg-bin/fcgi_agent_zhenghe.fcg?UIN='.$_POST['qq'].'&TYPE=16&PAGE_START=1&PAGE_END=10000&SELECT_FLAG=1';
$data=openu($qqurl);
preg_match_all("/<xsinger_name>(.*?)<\/xsinger_name>/is",$data,$singer_name);
preg_match_all("/<xsong_name>(.*?)<\/xsong_name>/is",$data,$song_name);
preg_match_all("/<xsong_url>(.*?)<\/xsong_url>/is",$data,$song_url);
preg_match_all("/<xmusicnum>(.*?)<\/xmusicnum>/is",$data,$song_num);
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>QQ:<?=$qq?> QQ空间音乐偷看器</title>
<style>
<!--
body,td { font-family: 宋体; font-size: 12px }
input { height: 20px }
a:link {color: #000080;text-decoration: none }
a:visited {color: #000080;text-decoration: none}
a:hover {color: #000080;text-decoration: underline }
-->
</style>
</head>
<body>
<table border="1" width="680" cellspacing="0" cellpadding="5" bordercolor="#CCCCCC" bgcolor="#EEEEEE" style="border-collapse: collapse">
<form method="POST" action="?act=seek" method="POST">
<tr>
<td width="50%">QQ空间音乐查询系统</td>
<td width="50%"> 输入QQ号: <input type="text" name="qq" size="20" value=""> <input type="submit" value="查询"></td>
</tr>
</form>
</table>
<table border="1" width="680" cellspacing="0" cellpadding="5" bordercolor="#CCCCCC" style="border-collapse: collapse">
<tr align="center" bgcolor="#EEEEEE">
<td >歌手</td>
<td width="100">歌曲名</td>
<td>地址</td>
</tr>
<?php
$singerarr=arrContentReplact($singer_name[1]);
$songarr=arrContentReplact($song_name[1]);
$urlarr=arrContentReplact($song_url[1]);
for($i=0;$i<$song_num[1][0];$i++){
$singer=$singerarr[$i];
$song=$songarr[$i];
$url=$urlarr[$i];
echo'<tr>
<td align="center">'.$singer.'</td>
<td>'.$song.'</td>
<td><a href="'.$url.'" target="_blank">'.$url.'</a></td>
</tr>';
}
?>
</table>
<p align="center"><a href="http://www.52crack.com">Power By 52Crack.com</a></p>
</body>
</html>
代码下载地址:http://www.codepub.com/software/view-software-12171.html
