Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [php]Klasa phplibgg, problem, Problem z stworzeniem gadugadu w php
wert1
post 11.01.2008, 20:12:08
Post #1





Grupa: Zarejestrowani
Postów: 175
Pomógł: 2
Dołączył: 22.03.2007
Skąd: localhost

Ostrzeżenie: (0%)
-----


Witajcie,
zabrałem się za robienie bramki Gadu-Gadu przez WWW.
I mam pare problemów z działaniem klasyphplibgadu autorstwa Anakina.
Gdy chce wysłać wiadomośc za pomocą tego skryptu :

  1. <?php 
  2. /* 
  3.  * @author : Anakin 
  4.  */ 
  5.  
  6. include 'phplibgadu.php'; 
  7.  
  8.  
  9. $gg = new GG; 
  10. $gg -> connect(12068549, 'hasło'); 
  11. $gg -> changeStatus(GG_STATUS_AVAILABLE_DESCR, '@WERT - Online'); 
  12. $gg -> sendMessage('6865186', 'Witaj') or die('nie można wysłać wiadmości');
  13. $gg -> disconnect('@WERT'); 
  14. ?>


Wywala mi taki bład :

CODE
Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: hostname nor servname provided, or not known in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 338

Warning: fsockopen() [function.fsockopen]: unable to connect to appmsg.gadu-gadu.pl:80 (Unknown error) in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 338


drugi problem powstaje przy pobieraniu wiadomosci :

  1. <?php 
  2. /* 
  3.  * @author : Anakin 
  4.  */ 
  5.  include 'phplibgadu.php';  
  6.  $gg = new GG; 
  7.  $gg -> connect(12068549, 'hasło');
  8.  $gg -> changeStatus(GG_STATUS_AVAILABLE, '@WERT - Online');  
  9.  
  10.  while (1) {
  11.  sleep(1);
  12.  $gg->ping();
  13.  
  14.  // Sprawdzamy czy s? jakie? pakiety wys?ane do nas
  15.  if (($packet = $gg->readPacket()) === false) {
  16. continue;
  17.  }
  18.  
  19.  // Czytamy pakiety
  20.  $packet = $gg->handlePacket($packet);
  21.  
  22.  if ($packet['type'] == GG_RECV_MSG) {
  23.  
  24.  print ($packet['msg']);  
  25.  break;
  26.  }
  27.  }
  28.  $gg -> disconnect('@WERT'); 
  29. ?>


problem powstaje gdy skrypt ma odebrać wiecej niż jeden pakiet :/
CODE

Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: hostname nor servname provided, or not known in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 338

Warning: fsockopen() [function.fsockopen]: unable to connect to appmsg.gadu-gadu.pl:80 (Unknown error) in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 338

Warning: fsockopen() [function.fsockopen]: unable to connect to 217.17.41.83:8074 (Operation timed out) in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 80

Warning: fwrite(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 111

Warning: fwrite(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 189

Warning: fread(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 203

Warning: fwrite(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 189

Warning: fread(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 203

Warning: fwrite(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 189

Warning: fread(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 203

Warning: fwrite(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 189

Warning: fread(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 203

Warning: fwrite(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 189

Warning: fread(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 203

Warning: fwrite(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 189

Warning: fread(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 203

Warning: fwrite(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 189

Warning: fread(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 203

Warning: fwrite(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 189

Warning: fread(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 203

Warning: fwrite(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 189

Warning: fread(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 203

Warning: fwrite(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 189

Warning: fread(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 203

Warning: fwrite(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 189

Warning: fread(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 203

Warning: fwrite(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 189

Warning: fread(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 203

Warning: fwrite(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 189

Warning: fread(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 203

Warning: fwrite(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 189

Warning: fread(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 203

Warning: fwrite(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 189

Warning: fread(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 203

Warning: fwrite(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 189

Warning: fread(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 203

Warning: fwrite(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 189

Warning: fread(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 203

Warning: fwrite(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 189

Warning: fread(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 203

Warning: fwrite(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 189

Warning: fread(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 203

Warning: fwrite(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 189

Warning: fread(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 203

Warning: fwrite(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 189

Warning: fread(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 203

Warning: fwrite(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 189

Warning: fread(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 203

Warning: fwrite(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 189

Warning: fread(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 203

Warning: fwrite(): supplied argument is not a valid stream resource in /home/wert/domains/wert.cyberdusk.pl/public_html/wert/gadu/phplibgadu.php on line 189


oraz gdy napisze wiadomosc przed zalogowaniem się skryptu

wtedy wogóle jej nie odbiera sad.gif

Ten post edytował wert1 11.01.2008, 20:29:49


--------------------
"Homo sum, humani nihil a me alienum puto."
"Necessitas ultimum et maximum telum est."
"Ventem seminabunt et turbinem metent."
"Gallia est omnis divisa in partes tres..."
Go to the top of the page
+Quote Post
anonim1133
post 12.01.2008, 10:01:14
Post #2





Grupa: Zarejestrowani
Postów: 53
Pomógł: 5
Dołączył: 22.07.2006
Skąd: Legnica

Ostrzeżenie: (0%)
-----


Cytat
unable to connect to 217.17.41.83:8074 (Operation timed out)


może gg zmieniło adresy serwerów? tongue.gif
Go to the top of the page
+Quote Post
wert1
post 16.01.2008, 18:15:00
Post #3





Grupa: Zarejestrowani
Postów: 175
Pomógł: 2
Dołączył: 22.03.2007
Skąd: localhost

Ostrzeżenie: (0%)
-----


no to co mam robic questionmark.gif


--------------------
"Homo sum, humani nihil a me alienum puto."
"Necessitas ultimum et maximum telum est."
"Ventem seminabunt et turbinem metent."
"Gallia est omnis divisa in partes tres..."
Go to the top of the page
+Quote Post
Maxik
post 16.01.2008, 18:16:24
Post #4





Grupa: Zarejestrowani
Postów: 726
Pomógł: 129
Dołączył: 10.01.2008
Skąd: Gdańsk

Ostrzeżenie: (0%)
-----


Adresy serwerów: http://www.kadu.net/monitor/


--------------------
Pomogłem? Kliknij przycisk Pomógł pod pomocnym Ci postem.
http://maxik.me/
Go to the top of the page
+Quote Post
wert1
post 16.01.2008, 18:33:59
Post #5





Grupa: Zarejestrowani
Postów: 175
Pomógł: 2
Dołączył: 22.03.2007
Skąd: localhost

Ostrzeżenie: (0%)
-----


problemy robi ta funkcja
  1. <?php
  2. // }}}
  3. // {{{ _findServer()
  4. /**
  5. * Metoda pobierajaca IP oraz port serwera Gadu-Gadu
  6. *
  7. * @param integer $uid numer Gadu-Gadu użytkownika
  8. *
  9. * @access private
  10. * @return mixed (boolean, string)
  11. */
  12. function _findServer($uid) {
  13.  
  14. if ($hSocket = fsockopen('appmsg.gadu-gadu.pl', 80, &$errorNumber, &$errorString, GG_CONN_TIMEOUT)) {
  15. fputs($hSocket, "GET /appsvc/appmsg4.asp?fmnumber=".$uid." HTTP/1.1r\nHost: appmsg.gadu-gadu.plr\n".
  16. "User-Agent: Mozilla/4.7 [en] (Win98; I)r\nPragma: no-cacher\nr\n");
  17. while (($tmpData = fgets($hSocket, 128)) !== false)
  18. $sData = $tmpData;
  19. fclose($hSocket);
  20.  
  21. if (strstr('notoperating', $sData)) return false;
  22. if (!ereg('(([0-9]{1,3}.){3}[0-9]{2,3}):([0-9]{1,5})', $sData, $aRegs) || !ip2long($aRegs[1]))
  23. return false;
  24. return array($aRegs[1], $aRegs[3]);
  25. }  
  26. return false;
  27. }
  28. ?>


ma ktos pomysl jak ja naprawic questionmark.gif wpisanie adresu ip nic nie daje


--------------------
"Homo sum, humani nihil a me alienum puto."
"Necessitas ultimum et maximum telum est."
"Ventem seminabunt et turbinem metent."
"Gallia est omnis divisa in partes tres..."
Go to the top of the page
+Quote Post
czopas
post 19.02.2008, 17:17:36
Post #6





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 24.02.2007

Ostrzeżenie: (0%)
-----


Zgadza się, że czasem wysyłanie wysypuje się w momencie połączenia z serwerem GG.
Zna ktoś jakiś patent na tą sprawę? Może trzeba by dodać jakieś adresy w bibliotece phplibgadu ?

A czy u wszystkich występuje taka sytuacja, że gdy wysyła informacje na GG to tekst jest pogrubiony ?
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 12.06.2025 - 18:06