代码拉取完成,页面将自动刷新
<?php
/**
* 图灵机器人接口调用
*
* 参考:http://www.tuling123.com/help/h_cent_webapi.jhtml?nav=doc
*
* @author: andy 2017-11-25
*/
class Tuling123_Lite {
protected $config;
private $tingling123_host = "http://www.tuling123.com/openapi/api";
/**
* @param string $key 图灵机器人key
*/
public function __construct($key = NULL) {
$this->key = $key;
if ($this->key === NULL) {
$this->key = DI()->config->get('app.Tuling123.key');
}
DI()->loader->addDirs('./Library/Tuling123/Tuling123');
}
//组装请求参数
private function getUrl($info)
{
$url = $this->tingling123_host;
$url .= "?";
$url .= "info=" . $info;
$url .= "&key=" . $this->key;
return $url;
}
//发送信息
public function send($info)
{
$url = $this->getUrl($info);
$curl = new PhalApi_CUrl();
$response = $curl->get($url, 3000);
return @json_decode($response, true);
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。