⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 collectclass.php

📁 实时统计出pc蛋蛋的幸运28开奖数据
💻 PHP
字号:
<?php
class class_collect
{

    function read( $url )
    {
        global $iotime;
        $mtime = explode( " ", microtime( ) );
        $starttime = $mtime[1] + $mtime[0];
        $content = "";
        if ( $fp = @fopen( $url, "r" ) )
        {
            while ( $fp && !feof( $fp ) )
            {
                @$content .= @fread( $fp, 1024 );
            }
            @fclose( $fp );
        }
        $mtime = explode( " ", microtime( ) );
        $iotime += $mtime[1] + $mtime[0] - $starttime;
        return $content;
    }

}
class c_post
{
	var $USER_AGENT = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Maxthon)";

	function read( $remoteserver, $port, $loginfile, $CurrentPageIndex)
    {
        @$fp = @fsockopen( $remoteserver, $port );
        if ( !$fp )
        {
            return false;
        }
        else
        {
			$postdata = "CurrentPageIndex={$CurrentPageIndex}";
			
            $sendheader = "POST {$loginfile} HTTP/1.1\r\nAccept: */*\r\nReferer: http://{$remoteserver}".( $port == 80 ? "" : ":{$port}" )."{$loginfile}\r\nAccept-Language: zh-cn\r\nAccept-Encoding: none\r\nContent-Type: application/x-www-form-urlencoded\r\nUser-Agent: {$this->USER_AGENT}\r\nHost: {$remoteserver}\r\n";
            $sendheader .= "Connection:Close\r\nPragma: no-cache\r\nCache-Control: no-cache\r\nContent-Length: ".strlen( $postdata )."\r\n\r\n";

            $postdata .= "\r\n\r\n";
            @fwrite( $fp, $sendheader );
            @fwrite( $fp, $postdata );
            $content = "";

            while ( $fp && @!feof( $fp ) )
            {
                $content .= fread( $fp, 1024 );
            }
			return $content;
        }
    }
}
class class_post
{

    var $cookiehash = "";
    var $USER_AGENT = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Maxthon)";

    function login( $remoteserver, $port, $loginfile, $username, $password )
    {
        @$fp = @fsockopen( $remoteserver, $port );
        if ( !$fp )
        {
            $this->cookiehash = "";
            return false;
        }
        else
        {
            $postdata = "pwuser={$username}&pwpwd={$password}&step=2&hideid=0&cktime=0&submit=%%CC%%E1+%%BD%%BB";
            $sendheader = "POST {$loginfile} HTTP/1.1\r\nAccept: */*\r\nReferer: http://{$remoteserver}".( $port == 80 ? "" : ":{$port}" )."/{$loginfile}\r\nAccept-Language: zh-cn\r\nAccept-Encoding: none\r\nContent-Type: application/x-www-form-urlencoded\r\nUser-Agent: {$this->USER_AGENT}\r\nHost: {$remoteserver}\r\n";
            $sendheader .= "Connection:Close\r\nPragma: no-cache\r\nCache-Control: no-cache\r\nContent-Length: ".strlen( $postdata )."\r\n\r\n";
            $postdata .= "\r\n\r\n";
            @fwrite( $fp, $sendheader );
            @fwrite( $fp, $postdata );
            $content = "";
            while ( $fp && @!feof( $fp ) )
            {
                $content .= fread( $fp, 1024 );
            }
            if ( ( $pos = strpos( $content, "Set-Cookie: winduser=" ) ) !== false )
            {
                $pos += 12;
                $endpos = strpos( $content, ";", $pos );
                $this->cookiehash = substr( $content, $pos, $endpos - $pos );
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}

class pc
{
	var $temp_content;
	var $item = Array();

	function pc($aa)
	{
		$this->temp_content = $aa;
	}
	function finditem()
	{
		for($i=24;$i>0;$i--)
		{
			$temp = '';
			$cn1= strrpos($this->temp_content,'<td height="32" bgcolor="#FFFaC7">');
			$temp=trim(substr($this->temp_content,$cn1));
			$issue=substr($temp,34,6);
			$cnt=strrpos($temp,'<td height="28" bgcolor="#FFFFFF">');
			$temp=substr($temp,0,$cnt);
			//echo $temp."\n";
			$cn2= strrpos($temp,'<td height="28" bgcolor="#');
			$time=substr($temp,$cn2+34,11);
			
			$cn3=strrpos($temp,"chkResult('");
			$num= substr($temp,$cn3+11,9);
			list($num1,$num2,$num3) = explode("+",$num);

			$this->item[]=array('issue'=>trim($issue),'time'=>"2008-".$time.":00",'num1'=>trim($num1),'num2'=>trim($num2),'num3'=>trim($num3));
			//echo $issue.'===='.$time.'===='.$num1.'===='.$num2.'===='.$num3."\n";
			$this->temp_content=trim(substr($this->temp_content,0,$cn1));
		}
		/*foreach($this->item as $arraylist)
		{
			foreach ($arraylist as $key=>$value)
			{
				echo $key."\t";
				echo $value."\t";
			}
			echo "\n";
		}*/
	}
	function item_add($con)
	{
		for($i=0;$i<24;$i++)
		{
			$issue =$this->item[$i]['issue'];
			$time =$this->item[$i]['time'];
			//$e_time=$this->p_time($time);
			//echo $e_time;
			$num1 =$this->item[$i]['num1'];
			$num2 =$this->item[$i]['num2'];
			$num3 =$this->item[$i]['num3'];
			$query=$con->get_one("select count(*) as count from pceggs where issue='$issue';");
			if(!$query['count'])
			{
				$sql="INSERT INTO `pceggs` values('$issue','$num1','$num2','$num3','$time');";
				//echo $sql;
				$con->query($sql);
			}
		}
	}
	function p_time($time)
	{
		list($time1,$time2)=explode(' ',$time);
		list($y,$m,$d)=explode('-',$time1);
		list($s,$f,$m)=explode(':',$time2);
		$k_time=gmmktime($s,$f,$m,$m,$d,$y);
		return $k_time;
	}
}
function mytrim( $str )
{
    $str = trim( $str );
    while ( substr( $str, 0, 2 ) == " " )
    {
        $str = substr( $str, 2 );
    }
    return $str;
}

function outputmsg( $msg )
{
    echo $msg."<br>";
    flush( );
    ob_flush( );
}

function ShowMsg($msg,$gourl,$onlymsg=0,$limittime=0)
{
	  global $dsql,$cfg_ver_lang;
	  if( eregi("^gb",$cfg_ver_lang) ) $cfg_ver_lang = 'gb2312';
		$htmlhead  = "<html>\r\n<head>\r\n<title> 系统提示</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset={$cfg_ver_lang}\" />\r\n";
		$htmlhead .= "<base target='_self'/>\r\n</head>\r\n<body leftmargin='0' topmargin='0'>\r\n<center>\r\n<script>\r\n";
		$htmlfoot  = "</script>\r\n</center>\r\n</body>\r\n</html>\r\n";

		if($limittime==0) $litime = 5000;
		else $litime = $limittime;

		if($gourl=="-1"){
			if($limittime==0) $litime = 5000;
			$gourl = "javascript:history.go(-1);";
		}

		if($gourl==""||$onlymsg==1){
			$msg = "<script>alert(\"".str_replace("\"","“",$msg)."\");</script>";
		}else{
			$func = "      var pgo=0;
      function JumpUrl(){
        if(pgo==0){ location='$gourl'; pgo=1; }
      }\r\n";
			$rmsg = $func;
			$rmsg .= "document.write(\"<br/><div style='width:400px;padding-top:4px;height:24;font-size:10pt;border-left:1px solid #b9df92;border-top:1px solid #b9df92;border-right:1px solid #b9df92;background-color:#def5c2;'>系统 提示信息:</div>\");\r\n";
			$rmsg .= "document.write(\"<div style='width:400px;height:100;font-size:10pt;border:1px solid #b9df92;background-color:#f9fcf3'><br/><br/>\");\r\n";
			$rmsg .= "document.write(\"".str_replace("\"","“",$msg)."\");\r\n";
			$rmsg .= "document.write(\"";
			if($onlymsg==0){
				if($gourl!="javascript:;" && $gourl!=""){ $rmsg .= "<br/><br/><a href='".$gourl."'>如果你的浏览器没反应,请点击这里...</a>"; }
				$rmsg .= "<br/><br/></div>\");\r\n";
				if($gourl!="javascript:;" && $gourl!=""){ $rmsg .= "setTimeout('JumpUrl()',$litime);"; }
			}else{ $rmsg .= "<br/><br/></div>\");\r\n"; }
			$msg  = $htmlhead.$rmsg.$htmlfoot;
		}
		//if(isset($dsql) && is_object($dsql)) @$dsql->Close();
		echo $msg;
}


?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -