public static function getLoginAddress($content)
{
preg_match('/.*?<\s*iframe\s*id\s*=\s*"login_frame"\s*name\s*=\s*"login_frame".*?src\s*=\s*"(.*?xui\.ptlogin2\.qq\.com.*?)".*?>\s*<\/iframe>.*?/', $content, $m);
if (count($m) > 1) {
return html_entity_decode($m[1]);
}
return null;
}
public static function checkLoginSuccess($content)
{
preg_match_all('/.*?\((.*)\).*?/', $content, $match);
if ($match[1][0]) {
$g = explode(',', $match[1][0]);
if (count($g) > 1) {
if (($g[count($g) - 2]) == "'登录成功!'") {
$url_parts = parse_url($g[2]);
parse_str($url_parts['query'], $arr);
if (array_key_exists('ptsig', $arr)) {
$ptsig = $arr['ptsig'];
} else {
$ptsig = null;
}
return array('status' => true, 'value' => array('url' => $g[2], 'ptsig' => $ptsig));
}
}
}
return array('status' => false);
}
public static function rightFrameVisitors($content)
{
$visitor_list = array();
$f = preg_replace('/\s*/', '', $content);
$f = preg_replace('/.*?_Callback\((\{.*?\})\).*?/', '$1', $f);
$f = json_decode($f, true);
if (is_array($f) && count($f) > 0 && array_key_exists('data', $f)
&& array_key_exists('module_3', $f['data'])
&& array_key_exists('data', $f['data']['module_3'])
&& array_key_exists('items', $f['data']['module_3']['data'])
) {
$visitors = $f['data']['module_3']['data']['items'];
foreach ($visitors as $visitor) {
if (!array_key_exists('loc', $visitor)) {
$visitor_list [] = array(
'uin' => $visitor['uin'], 'name' => $visitor['name'], 'online' => $visitor['online'], 'time' => $visitor['time'],
'img' => $visitor['img'], 'yellow' => $visitor['yellow'], 'supervip' => $visitor['supervip'],
);
}
}
}
return $visitor_list;
}
public static function getVisitors($content)
{
$f = preg_replace('/\s*/', '', $content);
preg_match('/^.*?(\{.*?\})\);\s*$/', $f, $m);
$visitor_list = array();
if (is_array($m) && count($m) > 1 && strlen($m[1]) > 0) {
$visitors = json_decode(trim($m[1]), true);
if (array_key_exists('data', $visitors) && array_key_exists('items', $visitors['data'])) {
foreach ($visitors['data']['items'] as $visitor) {