Skip to content

Instantly share code, notes, and snippets.

@egbertp
Created January 20, 2015 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save egbertp/aea8e68c40990c011107 to your computer and use it in GitHub Desktop.
Save egbertp/aea8e68c40990c011107 to your computer and use it in GitHub Desktop.
Wholla!
$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