config.php
代码如下:
define('APP_DIR', dirname(__FILE__));
define('COOKIE_FILE', APP_DIR . '/app.cookie.txt'); //会话记录文件
define('VISITOR_CAPTURE_INTERVAL', 3); //QQ采集间隔
define('VISITOR_DATA_UPLOAD_INTERVAL', '');
define('THIS_TIME', time());
define('REQUEST_TIMEOUT', 20); //请求超时20秒
define('END_LINE', "n");
define('DEBUG', true); //开启调试
$login_users = array(
array('user' => '2064556526', 'password' => '909124951'),
array('user' => '483258700', 'password' => '909124951'),
array('user' => '1990270522', 'password' => '909124951'),
array('user' => '2718711637', 'password' => '909124951'),
array('user' => '2841076562', 'password' => '909124951'),
);
qy.visitor.php
代码如下:
include('./config.php');
include(APP_DIR . '/qy.visitor.php');
$sessions = array();
$user = $login_users[array_rand($login_users)];
$visitor_capture = new QQVisitorCapture($user['user'], $user['password'], COOKIE_FILE, REQUEST_TIMEOUT, DEBUG, END_LINE);
$visitors = $visitor_capture->getVisitorInfo();
if (empty($visitors)) {
$this->clearCookies(true);
} else {
$cckf_service = new CCKFService(SECURITY_KEY,SERVICE_ID,SERVICE_ADDRESS,'', REQUEST_TIMEOUT, DEBUG, END_LINE);
}
qy.class.php
代码如下:
class Trace
{
public static function nl($num = 1)
{
$str = '';
for ($i = 0; $i < $num; $i++) {
$str .= "n";
}
return $str;
}
public static function br($num = 1)
{
$str = '';
for ($i = 0; $i < $num; $i++) {
$str .= "
";
}
return $str;
}
public static function write($content, $end_line, $title = null)
{
$close = '^^^^^^^^^^^^^^^^^';
if ($title) {
$start = '--------' . $title . '---------';
} else {
$start = '-----------------';
}
echo $start . $end_line;