Advertisement
Guest User

Untitled

a guest
Nov 28th, 2015
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1. <?php
  2.  
  3. // Define o tempo de execução ilimitado
  4. set_time_limit( 0 );
  5.  
  6. // Define o horário para brasil
  7. date_default_timezone_set( 'America/Sao_Paulo' );
  8.  
  9. // Dados de login
  10. $username = "5527988571807";
  11. $password = "N9lpAJRtpT+6nhbXoq/iq8J6Xhs=";
  12. $nickname = "Nescom";
  13. $target   = "5527996346399";
  14. $debug    = false;
  15.  
  16. // Inlui o arquivo com a classe
  17. require '../src/whatsprot.class.php';
  18. require 'exampleAudioReceiveEvent.php';
  19. while ( true ) {
  20.     try {
  21.  
  22.         $w      = new WhatsProt( $username, $nickname, $debug );
  23.         $events = new Events( $w );
  24.         $events->setEventsToListenFor( $events->activeEvents );
  25.         $w->connect();
  26.         $w->loginWithPassword( $password );
  27.  
  28.         while ( $w->pollMessage() ) {
  29.             ;
  30.         }
  31.  
  32.         $w->sendPing();
  33.  
  34.         sleep( 10 );
  35.  
  36.     } catch ( Exception $e ) {
  37.         echo "Houve exception, vai reiniciar o programa\n";
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement