當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WhatsProt::sendGetRequestLastSeen方法代碼示例

本文整理匯總了PHP中WhatsProt::sendGetRequestLastSeen方法的典型用法代碼示例。如果您正苦於以下問題:PHP WhatsProt::sendGetRequestLastSeen方法的具體用法?PHP WhatsProt::sendGetRequestLastSeen怎麽用?PHP WhatsProt::sendGetRequestLastSeen使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WhatsProt的用法示例。


在下文中一共展示了WhatsProt::sendGetRequestLastSeen方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

    }
    $line = fgets_u(STDIN);
    if ($line != '') {
        if (strrchr($line, ' ')) {
            $command = trim(strstr($line, ' ', true));
        } else {
            $command = $line;
        }
        switch ($command) {
            case '/query':
                $dst = trim(strstr($line, ' ', false));
                echo "[] Interactive conversation with {$contact}:\n";
                break;
            case '/lastseen':
                echo "[] Last seen {$target}: ";
                $w->sendGetRequestLastSeen($target);
                break;
            default:
                $w->sendMessage($target, $line);
                break;
        }
    }
}
class ProcessNode implements NewMsgBindInterface
{
    protected $wp = false;
    protected $target = false;
    public function __construct($wp, $target)
    {
        $this->wp = $wp;
        $this->target = $target;
開發者ID:jonathan-r,項目名稱:Chat-API,代碼行數:31,代碼來源:Simple+CLI+client.php

示例2: trim

        $line = fgets_u(STDIN);
        if ($line != "") {
            if (strrchr($line, " ")) {
                // needs PHP >= 5.3.0
                $command = trim(strstr($line, ' ', TRUE));
            } else {
                $command = $line;
            }
            switch ($command) {
                case "/query":
                    $dst = trim(strstr($line, ' ', FALSE));
                    echo "[] Interactive conversation with {$dst}:\n";
                    break;
                case "/lastseen":
                    echo "[] Request last seen {$dst}: ";
                    $wa->sendGetRequestLastSeen($dst);
                    break;
                default:
                    echo "[] Send message to {$dst}: {$line}\n";
                    $wa->sendMessage($dst, $line);
                    break;
            }
        }
    }
    exit(0);
}
if ($_SERVER['argv'][1] == "-l") {
    echo "\n[] Listen mode:\n";
    while (TRUE) {
        $wa->pollMessages();
        $data = $wa->getMessages();
開發者ID:diamondobama,項目名稱:WhatsAPI,代碼行數:31,代碼來源:whatsapp.php

示例3: onGetProfilePicture

    // extract the remaining seconds
    $remainingSeconds = $minuteSeconds % $secondsInAMinute;
    $seconds = ceil($remainingSeconds);
    // return the value
    if ($seconds == null & $minutes == null & $hours == null & $days == null) {
        echo "El contacto tiene desactivado esta función";
    } else {
        if ($seconds == 0 & $minutes == 0 & $hours == 0 & $days == 0) {
            echo "En línea";
        } else {
            echo $days . " días " . $hours . " horas " . $minutes . " minutos";
        }
    }
}
$w->eventManager()->bind('onGetRequestLastSeen', 'onGetRequestLastSeen');
$w->sendGetRequestLastSeen($contacts);
//This function only needed to show how eventmanager works.
function onGetProfilePicture($from, $target, $type, $data)
{
    if ($type == "preview") {
        $filename = "preview_" . $target . ".jpg";
    } else {
        $filename = $target . ".jpg";
    }
    $filename = WhatsProt::PICTURES_FOLDER . "/" . $filename;
    $fp = @fopen($filename, "w");
    if ($fp) {
        fwrite($fp, $data);
        fclose($fp);
    }
    echo '<a href="' . $filename . '"><center><img src="' . $filename . '" height="250" width="250"></center></a><br><br>';
開發者ID:aristofanio,項目名稱:WhatsApp-Tools,代碼行數:31,代碼來源:perfil.php

示例4: Tracker

echo "====================================================\n";
echo "               WhatsApp tracker v0.1                \n";
echo "====================================================\n\n";
echo "[*] Logging in as WhatsApp Tracker ({$sender})\n";
$wa = new WhatsProt($sender, 'WhatsApp Tracker', FALSE);
$wa->connect();
$wa->loginWithPassword($password);
$events = new MyEvents($wa);
$wa->eventManager()->bind('onGetRequestLastSeen', 'onGetRequestLastSeen');
$wa->eventManager()->bind("onPresenceAvailable", "onPresenceAvailable");
$wa->eventManager()->bind("onPresenceUnavailable", "onPresenceUnavailable");
if ($_SERVER['argv'][1] == "-cRemote0" || $_SERVER['argv'][1] == "-check") {
    echo "\n[-] Tracker mode (ON):\n";
    while (TRUE) {
        if ($_SERVER['argv'][1] == "-check") {
            $wa->sendGetRequestLastSeen($dst);
        } else {
            $wa->sendGetRequestLastSeen($_SERVER['argv'][3]);
            $wa->sendMessage($dst, "(" . $_SERVER['argv'][3] . ") " . $ls);
        }
        sleep(60);
    }
}
if ($_SERVER['argv'][1] == "-cHidden" || $_SERVER['argv'][1] == "-cRemote1") {
    echo "\n[-] Tracker mode (ON): Waiting the user to get online...\n";
    $wa->SendPresenceSubscription($dst);
    $wa->pollMessage();
    if ($presence == "available") {
        echo "- The user is now online\n\n";
    } else {
        echo "- The user is offline\n\n";
開發者ID:centaurustech,項目名稱:WA-Tracker,代碼行數:31,代碼來源:watracker.php


注:本文中的WhatsProt::sendGetRequestLastSeen方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。