- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
message.php
资源名称:alexa.rar [点击查看]
上传用户:xielong139
上传日期:2021-06-06
资源大小:92k
文件大小:5k
源码类别:
网络编程
开发平台:
DOS
- <?php
- header("Content-Type:text/html;charset=gbk");
- require_once 'Textclass.php';
- if($_POST['word'])$word=trim($_POST['word']);
- else $word=trim($_GET['url']);
- $word = __urljudge(str_replace('http://', '', $word));
- $content=array(url=>$word,ip=>$ip,time=>time());
- $text_class->add_line($content);
- function _url($Date){
- $ch = curl_init();
- $timeout = 5;
- curl_setopt ($ch, CURLOPT_URL, "$Date");
- curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");
- curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
- $contents = curl_exec($ch);
- curl_close($ch);
- return $contents;
- }
- $url="http://data.alexa.com/data/+wQ411en8000lA?cli=10&dat=snba&ver=7.0&cdt=alx_vw=20&wid=12206&act=00000000000&ss=1680x1050&bw=964&t=0&ttl=35371&vis=1&rq=4&url=$word";
- $contents.=_url($url);
- $contents=str_replace('<a href="/','<a href="http://www.alexa.com/',$contents);
- $contents = iconv("UTF-8","gbk//TRANSLIT",$contents);
- preg_match_all("/<POPULARITY URL="(.*?)" TEXT="(.*?)"/>/is",$contents,$num);
- if($num[1][0]==""){
- preg_match_all("/<div class="data down">(.*?)</a></div>/is",$contents,$num);
- }
- preg_match_all("/<CREATED DATE="(.*?)" DAY="(.*?)" MONTH="(.*?)" YEAR="(.*?)"/>/is",$contents,$date);
- preg_match_all("/<EMAIL ADDR="(.*?)"/>/is",$contents,$mail);
- preg_match_all("/<LINKSIN NUM="(.*?)"/>/is",$contents,$link);
- preg_match_all("/<ADDR STREET="(.*?)" CITY="(.*?)" STATE="(.*?)" ZIP="(.*?)" COUNTRY="(.*?)" />/is",$contents,$user);
- preg_match_all("/<CAT ID="(.*?)" TITLE="(.*?)" CID="(.*?)"/>/is",$contents,$type);
- preg_match_all("/<SITE BASE="(.*?)" TITLE="(.*?)" DESC="(.*?)">/is",$contents,$jianjie);
- ?>
- <div class="frame">
- <div class="title">您查询的网址:<b><?php echo $word;?></b> 在Alexa上的综合排名第<?php echo $num[2][0];?> 位</div>
- <div class="tab_2"><b>网站名称:</b><?php echo $num[1][0]?></div>
- <div class="tab_2"><b>网站排名:</b><?php echo $num[2][0];?></div>
- <div class="tab_2"><b>收录日期:</b><?php if(empty($date[1][0]))$date[1][0]='不详';echo $date[1][0];?></div>
- <div class="tab_2"><b>站长邮箱:</b><?php if(empty($mail[1][0]))$mail[1][0]='不详';echo $mail[1][0];?></div>
- <div class="tab_2"><b>反向链接:</b><?php if(empty($link[1][0]))$link[1][0]='不详';echo strip_tags($link[1][0]);?></div>
- <div class="tab_1"><b>联系方式:</b><?php if(empty($user[1][0]))$user[1][0]='不详';echo $user[1][0].$user[2][0].$user[3][0]?></div>
- <div class="tab_1"><b>分类目录:</b><?php if(empty($type[1][0]))$type[1][0]='不详';echo $type[1][0]?></div>
- <div class="tab_1"><b>网站简介:</b><?php if(empty($jianjie[3][0]))$jianjie[3][0]='不详';echo $jianjie[3][0]?></div>
- </div>
- <div class="clear"></div>
- <div class="frame">
- <div class="title">网站综合排名走势图</div>
- <table width="560" cellspacing="0">
- <tr>
- <td class="project_left"><a OnClick="document.all.rank1.style.display='';document.all.rank2.style.display='none';document.all.rank3.style.display='none';document.all.rank4.style.display='none';document.all.rank5.style.display='none';" style="cursor:hand">六个月平均排名</a></td>
- <td class="project"><a OnClick="document.all.rank1.style.display='none';document.all.rank2.style.display='';document.all.rank3.style.display='none';document.all.rank4.style.display='none';document.all.rank5.style.display='none';"style="cursor:hand">三个月平均排名</a></td>
- <td class="project"><a OnClick="document.all.rank1.style.display='none';document.all.rank2.style.display='none';document.all.rank3.style.display='';document.all.rank4.style.display='none';document.all.rank5.style.display='none';"style="cursor:hand">一个月平均排名</a></td>
- <td class="project"><a OnClick="document.all.rank1.style.display='none';document.all.rank2.style.display='none';document.all.rank3.style.display='none';document.all.rank4.style.display='';document.all.rank5.style.display='none';"style="cursor:hand">半个月平均排名</a></td>
- <td class="project"><a OnClick="document.all.rank1.style.display='none';document.all.rank2.style.display='none';document.all.rank3.style.display='none';document.all.rank4.style.display='none';document.all.rank5.style.display='';"style="cursor:hand">一星期平均排名</a></td>
- </tr>
- <tr>
- <td colspan="5" class="rank_left">
- <div id="rank1"><img src="http://traffic.alexa.com/graph?w=560&h=280&r=6m&y=t&u=<?php echo $word;?>" alt=" 如果看不到图片,请单击右键选择 [显示图片] "></div>
- <div id="rank2" style="display:none"><img src="http://traffic.alexa.com/graph?w=560&h=280&r=3m&y=t&u=<?php echo $word;?>" alt=" 如果看不到图片,请单击右键选择 [显示图片] "></div>
- <div id="rank3" style="display:none"><img src="http://traffic.alexa.com/graph?w=560&h=280&r=1m&y=t&u=<?php echo $word;?>" alt=" 如果看不到图片,请单击右键选择 [显示图片] "></div>
- <div id="rank4" style="display:none"><img src="http://traffic.alexa.com/graph?w=560&h=280&r=15.0m&y=t&u=<?php echo $word;?>" alt=" 如果看不到图片,请单击右键选择 [显示图片] "></div>
- <div id="rank5" style="display:none"><img src="http://traffic.alexa.com/graph?w=560&h=280&r=7.0m&y=t&u=<?php echo $word;?>" alt=" 如果看不到图片,请单击右键选择 [显示图片] "></div>
- </td>
- </tr>
- </table>
- <div><a href="http://www.alexa.gz.cn/">Alexa排名查询</a><div>
- </div>