/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?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() { ); } } ?>