ATB Source Codes

PHP news thieves searching information in reptiles Show core.php Source code

Return Download PHP news thieves searching information in reptiles: download core.php Source code - Download PHP news thieves searching information in reptiles Source code - Type:.php
  1. <?php
  2. /*
  3. || # ---------------------------------------------------------------- # ||
  4. || # 中搜资讯爬虫 Build 061215
  5. || # By explon (explon@gmail.com)
  6. || # --------------------------------------------------------------- # ||
  7. */
  8.  
  9. $TIMENOW = time();
  10. $doupdate = false;
  11.  
  12. if ($_GET['page'])
  13. {
  14.         $URL = "http://z.zhongsou.com/" . $_GET['page'] . ".htm";
  15.         $ThePage = $_GET['page'] . ".txt";
  16.         $CounterFile =  $_GET['page'] . ".dat";
  17. }
  18. else
  19. {
  20.         $URL = "http://z.zhongsou.com/";
  21.         $ThePage = "index.txt";
  22.         $CounterFile =  "index.dat";
  23. }
  24.  
  25. $fp = fopen($CounterFile, 'r');
  26. flock($fp, LOCK_EX);
  27. $counte = fgets($fp, 20);
  28.  
  29. if (($TIMENOW - $counte) > (60 * 5))
  30. {
  31.         $doupdate = true;
  32. }
  33.  
  34. flock($fp, LOCK_UN);
  35. fclose($fp);
  36.  
  37.  
  38. if ($doupdate)
  39. {
  40.  
  41.         require('./config.php');
  42.         require('./global.php');
  43.  
  44.         $Data = GetPage($URL);
  45.         $Page = CutData($Data, '<html>', '</html>');
  46.  
  47.         $Page = NoReturn($Page);
  48.  
  49.         $Page = str_replace('http://pic.zhongsou.com/3/newsimg/images/news-logo.gif', 'cache/logo.gif', $Page);
  50.         $Page = str_replace('中搜文明办网举报电话:010-62220330  举报邮箱:zs_content@zhongsou.com', $Config_Page_Bottom_ADCode, $Page);
  51.         $Page = str_replace('中搜资讯', $Config_SiteName, $Page);
  52.         $Page = str_replace('中搜在线', $Config_SiteName, $Page);
  53.         $Page = str_replace('中搜', $Config_SiteName, $Page);
  54.         $Page = str_replace('新闻搜索-', '', $Page);
  55.         $Page = str_replace('<form action="http://z.zhongsou.com/n" method="get" name=f1 target="_blank">               <td class=a2>                   <div class=a3><a href="http://www.zhongsou.com" target="_blank" class=ul>网页</a>&nbsp;&nbsp;&nbsp;<strong>资讯</strong>&nbsp;&nbsp;&nbsp;<a href="http://mp3.zhongsou.com" target="_blank" class=ul>MP3</a>&nbsp;&nbsp;&nbsp;<a href="http://img.zhongsou.com" target="_blank" class=ul>图片</a>&nbsp;&nbsp;&nbsp;<a href="http://bbs.zhongsou.com" target="_blank" class=ul>论坛</a>&nbsp;&nbsp;&nbsp;<a href="http://b.zhongsou.com" target="_blank" class=ul>贴吧</a>&nbsp;&nbsp;&nbsp;<a href="http://www.zhongsou.com/more.php" target="_blank" class=ul>更多</a>&gt;&gt;</div>                       <div>                           <span><input name="w" type="text" class=a4  size=35 maxlength=256></span>                               &nbsp;<span><input name="提交" type="submit" onClick="f1.oi.value=\'\'" value=" 搜索 "></span>                              <span><input name="提交" type="submit" value="搜索图片资讯" onClick="f1.oi.value=1;">                           <input name="oi" type="hidden"></span>                          &nbsp;&nbsp;&nbsp;<a href="http://b.zhongsou.com/l.dll?MfcISAPICommand=DoRequest&word=%D2%E2%BC%FB%B7%B4%C0%A1&rdi=bybar" target=_blank><font style="font-size:12px ">意见反馈</font></a>&nbsp;                     </div>          </td>                   </form>                 <td class=a5></td>', '<td class=a2>&nbsp;</td><td class=a5>' . $Config_Page_Top_ADCode . '</td>', $Page);
  56.         $Page = str_replace('href="/"', 'href="index.htm"', $Page);
  57.         $Page = str_replace('http://z.zhongsou.com', 'index.htm', $Page);
  58.         $Page = str_replace('中搜在线', '', $Page);
  59.         $Page = str_replace('意见反馈', '', $Page);
  60.  
  61.  
  62.         $Page = str_replace('<!--Start右分桢区--></td></tr></table>', '<div style="padding-top:10px; text-align:center">' . $Config_Page_Right_ADCode . '</div><!--Start右分桢区--></td></tr></table>', $Page);
  63.  
  64.         $Page = $Page . '<script type="text/javascript">
  65.         function $(obj){
  66.  
  67.                 if(typeof(obj) == "object")
  68.                 {
  69.  
  70.                         return obj;
  71.                 }
  72.                 else
  73.                 {
  74.                         return document.getElementById(obj);
  75.                 }
  76.  
  77.         }
  78.  
  79.         String.prototype.Trim = function(){return this.replace(/^\s+|\s+$/g,"");}
  80.         String.prototype.Ltrim = function(){return this.replace(/^\s+/g, "");}
  81.         String.prototype.Rtrim = function(){return this.replace(/\s+$/g, "");}
  82.  
  83.  
  84.  
  85.         var start=1000; // 初始位置
  86.         while($(start))
  87.         {
  88.         var oldstr;
  89.         oldstr=$(start).innerHTML;
  90.         var aa=oldstr.indexOf("-&nbsp;");
  91.         var bb=oldstr.substr(aa+6,oldstr.length);
  92.  
  93.         bb.Trim();
  94.  
  95.         var yy,mm,dd,hh,mn,ss,pp
  96.         pp=bb.indexOf("-");
  97.  
  98.         yy=bb.substr(1,4);
  99.         mm=bb.substr(pp+1,2);
  100.         dd=bb.substr(pp+4,2);
  101.         hh=bb.substr(pp+7,2);
  102.         mn=bb.substr(pp+10,2);
  103.         ss=bb.substr(pp+13,2);
  104.  
  105.         var otime=new Date(yy,mm-1,dd,hh,mn,ss);
  106.         var ctime=new Date();
  107.  
  108.         if(otime.getDate() != ctime.getDate())
  109.         {
  110.                 var datestr;
  111.  
  112.                 datestr = (otime.getMonth() + 1) + "月";
  113.  
  114.                 datestr += otime.getDate() + "日";
  115.                
  116.                 $(start).innerHTML = oldstr.substr(0,aa+1) + datestr;
  117.         }
  118.         else if(Math.floor((ctime-otime)/(60*1000)) <= 30 && Math.floor((ctime-otime)/(60*1000))>0)
  119.         {
  120.                 $(start).innerHTML=oldstr.substr(0,aa+1)+ " " +Math.floor((ctime-otime)/(60*1000))+"分钟前";
  121.         }
  122.         else
  123.         {
  124.                 $(start).innerHTML=oldstr.substr(0,aa+1)+ " " + hh + ":" + mn;
  125.         }
  126.  
  127.         start+=1;
  128.         }
  129.  
  130.         //document.getElementById("w").focus();
  131.  
  132.         </script>';
  133.        
  134.         $fp = fopen($ThePage, 'w');
  135.         flock($fp, LOCK_EX);
  136.         fputs($fp, $Page);
  137.         flock($fp, LOCK_UN);
  138.         fclose($fp);
  139.        
  140.         $fp = fopen($CounterFile, 'w');
  141.         flock($fp, LOCK_EX);
  142.         fputs($fp, $TIMENOW);
  143.         flock($fp, LOCK_UN);
  144.         fclose($fp);
  145.        
  146. }
  147.  
  148. @header('Content-Type: text/html');
  149. readfile($ThePage);
  150.  
  151. ?>
downloadcore.php Source code - Download PHP news thieves searching information in reptiles Source code
Related Source Codes/Software:
Encyclopedia of Chinese herbal medicine (6,024 records) - Encyclopedia of Chinese herbal medicine (6,024 rec... 9.89KB
Search engine spiders access log viewer source code - This software can view the search engine spiders t... 328byte
Web Spiders crawl statistics system 1.5 - To see the spiders access to the records, accordin... 184byte
An open source spider applet - Installation instructions:1, modify administra... 264byte
Sesame seeds (small) guestbook v2.0 - A very small message, admin: adimin/login.aspT... 464byte
Porridge spectrum (420 records) - The porridge of Spectra (79K,420 data)   248byte
Non-zero square link v3.0 - 1, the publishing feature (directly apply for addi... 204byte
2010 lunar new year wishes wall - Remember after installation delete install.php... 844byte
National Hotel booking system API static version V2.0 - 1, webmasters having to manually update, hotel inf... 432byte
Zhu Zhuxiang v4.88 - Album using optimization algorithms and data stora... 960byte
Space Forum spacebbs v1.0 - In the course of the preparation of this forum mai... 3.21KB
Multi-purpose search engine v1.0 - You want to make your site more powerful than Baid... 1008byte
Using DirectSound and MS Age ... - Using DirectSound and MS Agent to establish a... 56byte
77 collection trading system 1 - 77 collectable trading system was developed based ... 1.69KB
Multi-user network favorites programs - Multi-user network favorites programsProgr... 1.23KB
Fast counter v6.0 - 1.  page count feature anti-refresh (within a... 568byte
Sogou Rank queries thief - Sogou Rank queries thiefOn the Web page to joi... 20byte
"2011" Download Paradise (sky thief) 2 revisions - Latest Sky thief revisionsAmendment sky softwa... 552byte
Shareware granted the right to register an interface (platform) v1.0 - Can detect whether their programs are registered, ... 960byte
Software publishing specialized programs - This is a pure PHP software for online publishing ... 104byte

 Back to top