php5类,用于easybots
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php5类,用于easybots相关的知识,希望对你有一定的参考价值。
<?php /* EasyBots<http://www.easybots.cn> class by xuanyan <[email protected]> */ // example: // receive user message: // $token = 'xxxxx'; // $param = EasyBots::getParam(); // if ($param['token'] == $token) // { // // var_dump($param); // } // //exit; // ---------------------------- // send message to user: // $oapi_id = 'xxxxx'; // $ack = 'xxxxx'; // $bot = new EasyBots($oapi_id, $ack, 'gtalk:[email protected]'); // $bot->send('palapla'); // // or // $bot2 = new EasyBots($oapi_id, $ack, // array( // 'gtalk:[email protected]', // 'msn:[email protected]' // )); // $bot2->send('palapla'); class EasyBots { const URL = 'http://www.easybots.cn/oapi_mo.net'; private $oapi_id = null; private $ack = null; private $im = ''; public function __construct($oapi_id, $ack, $im) { } public function send($msg) { 'oapi_id' => $this->oapi_id, 'ack' => $this->ack, 'im' => $this->im, ); 'method' => 'POST', 'header'=> "Content-type: application/x-www-form-urlencoded " . ", 'content' => $data ) ); } public static function getParam() { ); } } ?>
以上是关于php5类,用于easybots的主要内容,如果未能解决你的问题,请参考以下文章