function zhineng_contents($url) { $a = getrobotmeg($url); $title = $a[leachsubject]; $contents = $a[leachmessage]; $fh = array('|', '_', '-', ' ', '―', '_', '!'); foreach ($fh as $s) { $title = ex($title, $s, 0); } return array(title => ' ' . trim($title), contents => $contents, tag => getkeyword($title)); }
} $html .= $blang['at'] . sgmdate($item['dateline']) . $blang['released'] . "\n" . cuthtml($item['message'], 100) . '[/quote]'; showxml($html); } } showxml($html); } elseif ($action == 'getrobotmsg') { include_once S_ROOT . './function/robot.func.php'; $arrayrobotmeg = array(); if (isset($_POST['referurl']) && !empty($_POST['referurl'])) { //萃取内容 $robotlevel = intval(postget('robotlevel')); if ($robotlevel > 2 || $robotlevel < 1) { exit; } $arrayrobotmeg = getrobotmeg($_POST['referurl'], $robotlevel); } //检查是否获取到信息 if (!empty($arrayrobotmeg['leachmessage'])) { $pagebreak = isset($_POST['itemid']) && intval($_POST['itemid']) == 0 ? 1 : 0; $arrayrobotmeg['leachsubject'] = preg_replace("/\r/", '', $arrayrobotmeg['leachsubject']); $arrayrobotmeg['leachmessage'] = addslashes($arrayrobotmeg['leachmessage']); print <<<EOF \t\t\t<script type="text/javascript"> \t\t\tparent.document.getElementById("subject").value = '{$arrayrobotmeg['leachsubject']}'; \t\t\tparent.document.getElementById("message").innerHTML = ''; \t\t\tfunction init() { \t\t\t\tparent.et = new parent.word("message", "{$arrayrobotmeg['leachmessage']}", 0, {$pagebreak}); \t\t\t} \t\t\tinit(); \t\t\tobjCharset = parent.document.getElementById('scharset');
$arraycell['pr'] -= 10; } if ($arraycell['pr'] >= 0) { $g1 = preg_replace("/\\<(p|br)[^\\>]*?\\>/si", "\n\n###p br explode###\n\n", $arraycell['code']); $arrayg1 = explode("\n\n###p br explode###\n\n", $g1); preg_match_all("/\n\n###p br explode###\n\n/is", $g1, $g4, PREG_SET_ORDER); if (count($g4) > 2) { $g3 = 0; foreach ($arrayg1 as $value) { $g2 = preg_replace("/[\n\r\\s]*?/is", "", preg_replace($searchaborative, $replaceaborative, $value)); if ($g2 != '') { $g2num = mb_strlen($g2, 'utf-8'); if ($g2num <= 25) { $g3--; } elseif ($g2num > 70) { $g3 = 10; continue; } else { $g3++; } } } if ($g3 < 0) { $arraycell['pr'] += $g3; } } } return $arraycell; } echo getrobotmeg($url, $content);