Esempio n. 1
0
<?php

require_once 'MessageBuilder.php';
require_once 'PushConnection.php';
PushConnection::$BOTAPI_LOGIN = '******';
PushConnection::$BOTAPI_PASSWORD = '******';
$P = new PushConnection(123456);
$M = new MessageBuilder();
switch ($HTTP_RAW_POST_DATA) {
    case "kot":
        $M->addText('Oto kot:');
        $M->addImage('kot.jpg');
        break;
    default:
        $M->addBBcode('A to jest GG:');
        $M->addImage('gg.png');
}
$M->reply();
Esempio n. 2
0
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see<http://www.gnu.org/licenses/>.
*******/
require_once dirname(__FILE__) . '/MessageBuilder.php';
define('CURL_VERBOSE', true);
// zmienić na true, jeśli chce się uzyskać dodatkowe informacje debugowe
define('STATUS_AWAY', 'away');
define('STATUS_FFC', 'ffc');
define('STATUS_BACK', 'back');
define('STATUS_DND', 'dnd');
define('STATUS_INVISIBLE', 'invisible');
PushConnection::$BOTAPI_LOGIN = '';
PushConnection::$BOTAPI_PASSWORD = '';
/**
 * @brief Klasa reprezentująca połączenie PUSH z BotMasterem.
 * Autoryzuje połączenie w trakcie tworzenia i wysyła wiadomości do BotMastera.
 */
class PushConnection
{
    /**
     * Obiekt autoryzacji
     *
     * Typ BotAPIAuthorization
     */
    public static $BOTAPI_LOGIN = NULL;
    public static $BOTAPI_PASSWORD = NULL;
    static $lastGg;