Created
January 20, 2015 15:57
-
-
Save egbertp/aea8e68c40990c011107 to your computer and use it in GitHub Desktop.
Wholla!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$userPhone = 'xxxxxxxxx'; | |
$userIdentity = strtolower(urlencode(sha1($userPhone, true)));; | |
$userName = 'admin'; | |
$password = 'xxxxxxxxxxx'; | |
$debug = true; | |
$w = new WhatsProt($userPhone, $userIdentity, $userName, $debug); | |
$w->Connect(); | |
$w->LoginWithPassword($password); | |
while($w->pollMessage()); | |
$pn = new ProcessNode($w, $userPhone); | |
$w->setNewMessageBind($pn); | |
while (true) { | |
$w->pollMessage(); | |
$msgs = $w->getMessages(); | |
foreach ($msgs as $m) { | |
# process inbound messages | |
print($m->NodeString("") . "\n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment