// 图灵机器人
private function _tuling($keyword) {
$api_url = $this->config ['tuling_url'] . "?key=" . $this->config ['tuling_key'] . "&info=" . $keyword;
$result = file_get_contents ( $api_url );
$result = json_decode ( $result, true );
if ($_GET ['format'] == 'test') {
dump ( '图灵机器人结果:' );
dump ( $result );
}
if ($result ['code'] > 40000) {
if ($result ['code'] < 40008 && ! empty ( $result ['text'] )) {
$this->replyText ( '图灵机器人请你注意:' . $result ['text'] );
} else {
return false;
}
}
switch ($result ['code']) {
case '200000' :
$text = $result ['text'] . ',<a href="' . $result ['url'] . '">点击进入</a>';
$this->replyText ( $text );
break;
case '200000' :
$text = $result ['text'] . ',<a href="' . $result ['url'] . '">点击进入</a>';
$this->replyText ( $text );
break;