当前位置: 首页>>代码示例>>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;未经允许,请勿转载。