Advertisement
Guest User

Untitled

a guest
Jul 14th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. <?PHP
  2. error_reporting(E_ALL);
  3. ini_set('display_errors', 1);
  4.  
  5. set_time_limit(90);
  6.  
  7. require_once __DIR__.'src/whatsprot.class.php';
  8. require_once __DIR__.'src/events/MyEvents.php';
  9.  
  10. //Change to your time zone
  11. date_default_timezone_set('America/Manaus');
  12.  
  13.  
  14.  
  15. public function onGetMessage( $mynumber, $from, $id, $type, $time, $name, $body )
  16. {
  17. echo "Message from $name:\n$body\n\n";
  18. }
  19.  
  20. $username = '559294603635';
  21. $password = 'io8zKRvnmq60Coug8ViZ0VpQuSM=';
  22. $nickname = 'William';
  23. $target = "559294511684";
  24. $debug = true;
  25.  
  26.  
  27. $w = new WhatsProt($username, $nickname, $debug);
  28. $w->connect();
  29. $w->loginWithPassword($password);
  30.  
  31. $w->eventManager()->bind('onGetMessage', 'onGetMessage');
  32.  
  33. $w->sendGetPrivacyBlockedList();
  34.  
  35. $w->sendGetClientConfig();
  36.  
  37. //$w->sendGetServerProperties();
  38.  
  39. $w->sendMessageImage($target, 'demo/x3.jpg');
  40. $w->sendMessage($target, 'Guess the number :)');
  41.  
  42.  
  43. while (1) {
  44. $w->pollMessage();
  45. }
  46.  
  47.  
  48. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement