西科人BBS_西安科技大学学生论坛

 找回密码
 立即注册
12
返回列表 发新帖
楼主: I.net

再试

[复制链接]
发表于 2007-6-7 21:38:12 | 显示全部楼层
等待
回复 支持 反对

使用道具 举报

发表于 2007-6-7 21:50:13 | 显示全部楼层
继续水
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-6-7 21:59:09 | 显示全部楼层
原帖由 ぁ简单爱ぁ 于 2007-6-7 21:32 发表



好呀,拭目以待



这是一个PHP的
有问题
我知道在哪里
呵呵
不改了
这个是以前的
不知道现在还能不能用

  1. set_time_limit(0);   
  2.   $uname   =   'I.net';$pwd   =   '*******';$site="http://www.xikeren.cn";login();$formhash=gethash();   
  3.    
  4.    
  5.   while(1){   
  6.   parse(45);   
  7.   //   parse(27);   
  8.   //   if($i++>10)   break;   
  9.   }   
  10.   echo   "全部刷完";   
  11.    
  12.    
  13.   function   parse($fid){//刷当前版第一页   
  14.   global   $site,$formhash,$uname;   
  15.   echo   "------------开刷--------$fid------------   ";   
  16.   $fd=file_get_contents("$site/forumdisplay.php?fid=$fid&page=");   
  17.   $tagarr=array("论坛主题","<table   width=");   
  18.   $startpos   =   strpos($fd,$tagarr[0])+strlen($tagarr[0]);$endpos   =   strpos($fd,$tagarr[1],$startpos);//截取标记   
  19.   $fd=substr($fd,$startpos,$endpos-$startpos);   
  20.   preg_match_all("/"viewthread.php?tid=([d]*)&.*<td   class="altbg2"   align="center">([d]*)</td>.*viewpro.*>(.*)</a>/sU",$fd,$fd);//print_r($fd);exit;   
  21.   unset($fd[0]);   
  22.   foreach($fd[1]   as   $key=>$val){   
  23.   if($fd[3][$key]<>$uname)   {   
  24.   curladd($val,$fd[3][$key]);   
  25.   echo   "-------------".$fd[2][$key]."--贴----最后回复--".$fd[3][$key]."----------$val-------   ";   
  26.   sleep(15);   
  27.   }else   {   
  28.    
  29.   }   
  30.   }   
  31.   }   
  32.   function   curladd($threadid,$author){//写入   
  33.   global   $site,$formhash;   
  34.   $add=time()%7==0?"   {$author}   的帖子一定要顶":'';   
  35.   $message=getanswer(getlastpost($threadid)).$add;   
  36.   $b="action=reply&tid=$threadid&replysubmit=yes&formhash=$formhash&subject=&usesig=1&message=".urlencode($message);   
  37.   $ch   =   curl_init();   
  38.   curl_setopt($ch,   CURLOPT_RETURNTRANSFER,1);   
  39.   curl_setopt($ch,   CURLOPT_COOKIEFILE,   "cookie.txt");   
  40.   curl_setopt($ch,   CURLOPT_URL,   "$site/post.php");   
  41.   curl_setopt($ch,   CURLOPT_POST,   1);   
  42.   curl_setopt($ch,   CURLOPT_POSTFIELDS,   $b);   
  43.   curl_setopt($ch,   CURLOPT_USERAGENT,   "Mozilla/99.99   (compatible;   MSIE   99.99;   Windows   XP   99.99)");   
  44.   curl_exec($ch);   
  45.   curl_close   ($ch);   
  46.   }   
  47.   function   getlastpost($tid){//得到最后回复   
  48.   global   $site;   
  49.   $url="$site/redirect.php?tid=$tid&goto=lastpost";   
  50.   $fd=file_get_contents($url);   
  51.   preg_match_all("/<span   style="font-size:   12px">(.*)</span>/isU",$fd,$fd);   
  52.   Return   end($fd[1]);   
  53.   }   
  54.   function   getanswer($con){//得到答案   
  55.   $url=   
  56.   "http://www.xiaoi.com/engine.isp?font=0&bold=0&italic=0&underline=0&fontColor=black&messageText=".urlencode($con)."&botid=popup-bot";   
  57.   $fd=file_get_contents($url);   
  58.   $startpos   =   strpos($fd,'</textarea>')+strlen('</textarea>');$endpos   =   strpos($fd,'</textarea>',$startpos);//截取标记   
  59.   $fd=trim(str_replace('<textarea   id="answer">','',substr($fd,$startpos,$endpos-$startpos)));   
  60.   $fdrep=array(   
  61.   "xikeren.cn"=>"xikeren.cn",   
  62.   "xikeren"=>"xikeren",   
  63.      
  64.   );   
  65.   foreach($fdrep   as   $key=>$val){   
  66.   $fd=str_replace($key,$val,$fd);   
  67.   }   
  68.   Return   $fd;   
  69.   }   
  70.   function   login(){//登陆   
  71.   global   $uname,$pwd,$formhash,$site;   
  72.   $strLoginData   =   "formhash=$formhash&loginfield=username&username=$uname&password=$pwd&loginsubmit=%CC%E1+%26%23160%3B+%BD%BB";   
  73.   $ch   =   curl_init();   
  74.   curl_setopt($ch,   CURLOPT_RETURNTRANSFER,1);   
  75.   curl_setopt($ch,   CURLOPT_URL,   "$site/logging.php?action=login");   
  76.   curl_setopt($ch,   CURLOPT_USERAGENT,   "Mozilla/99.99   (compatible;   MSIE   99.99;   Windows   XP   99.99)");   
  77.   curl_setopt($ch,   CURLOPT_POST,   1);   
  78.   curl_setopt($ch,   CURLOPT_POSTFIELDS,   $strLoginData);   
  79.   curl_setopt   ($ch,   CURLOPT_COOKIEJAR,   'cookie.txt');   
  80.   curl_exec($ch);   
  81.   curl_close   ($ch);   
  82.   }   
  83.   function   gethash(){   
  84.   $ch   =   curl_init();   
  85.   curl_setopt($ch,   CURLOPT_RETURNTRANSFER,1);   
  86.   curl_setopt($ch,   CURLOPT_URL,   "$site/post.php");   
  87.   curl_setopt($ch,   CURLOPT_USERAGENT,   "Mozilla/99.99   (compatible;   MSIE   99.99;   Windows   XP   99.99)");   
  88.   curl_setopt($ch,   CURLOPT_POSTFIELDS,   "action=newthread&fid=45&extra=page%3D1");   
  89.   curl_setopt($ch,   CURLOPT_POST,   1);   
  90.   curl_setopt($ch,   CURLOPT_COOKIEFILE,   "cookie.txt");   
  91.   $fd=curl_exec($ch);   
  92.   curl_close   ($ch);   
  93.   $tagarr=array('formhash"   value="','"');   
  94.   $startpos   =   strpos($fd,$tagarr[0])+strlen($tagarr[0]);$endpos   =   strpos($fd,$tagarr[1],$startpos);//截取标记   
  95.   Return   substr($fd,$startpos,$endpos-$startpos);   
复制代码
回复 支持 反对

使用道具 举报

发表于 2007-6-7 21:59:46 | 显示全部楼层
明显不行么
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-6-7 22:00:39 | 显示全部楼层
我晕
你以为把代码复制到这里就能水了???
我放空间上去了
执行了下
发现有问题
没改
回复 支持 反对

使用道具 举报

发表于 2007-6-7 22:01:15 | 显示全部楼层
。。。。。。。。
回复 支持 反对

使用道具 举报

发表于 2013-8-16 15:42:36 | 显示全部楼层
我是个凑数的。。。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|西科人BBS ( 粤ICP备20049523号-3 )

GMT+8, 2026-4-17 08:56 , Processed in 0.063592 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表