Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Pozycja w google - Podpięcie gotowego rozwiązania, Podpięcie gotowej klasy do sprawdzania pozycji w google
--pikasso--
post
Post #1





Goście







Cześć mam prośbę,

znalazłem, przynajmniej tak mi się wydaje fajny skrypt do sprawdzania pozycji w google.
Jednak nie potrafię go podpiąć....

adres do skryptu: http://shpyo.net/php/google-rank/

zakładając, że pobieram sobie gotową klasę z podanego wyżej linka w tym przypadku: class.checkPosition.php

co powinienem wrzucić w plik index.php aby mi wyświetliło taki wynik:

fraza 1 | pozycja w google
fraza 2 | pozycja w google
fraza 3 | pozycja w google

itd...

Z góry dziękuję za pomoc!!
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 6)
b4rt3kk
post
Post #2





Grupa: Zarejestrowani
Postów: 1 933
Pomógł: 460
Dołączył: 2.04.2010
Skąd: Lublin

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


Proponuję przeczytać dokumentację klasy. Zresztą wszystko o co pytasz jest podane na stronie do której link sam podałeś.

  1. $c = new checkPosition( array( 'http://strona.pl' ), array( 'fraza 1', 'fraza 2', 'fraza 3' ) );
  2. $c->getRank();
  3. $res = $c->getResults();
  4.  
  5. print_r($res);


--------------------
Jeśli pomogłem, kliknij proszę 'pomógł'. Dzięki.
Go to the top of the page
+Quote Post
--pikasso--
post
Post #3





Goście







Dzięki za pomoc ale chyba nic z tego ...
pewnie skrypt jest zły ....

  1. <?php
  2. require_once('class.checkPosition.php');
  3.  
  4. $c = new checkPosition( array( 'http://ayoa.pl' ), array( 'kubki', 'reklamowe', 'materialy' ) );
  5. $c->getRank();
  6. $res = $c->getResults();
  7.  
  8. print_r($res);
  9.  
  10. ?>


wyrzuca mi taki błąd:
http://www.google.com/sorry/?continue=http...bki%26num%3D100 < Content-Length: 296 < Date: Mon, 15 Jul 2013 10:37:48 GMT < Server: GFE/2.0 < * Connection #0 to host www.google.pl left intact * Closing connection #0 * About to connect() to www.google.pl port 80 (#0) * Trying 46.28.247.25... * connected * Connected to www.google.pl (46.28.247.25) port 80 (#0) > GET /search?hl=pl&q=reklamowe&num=100 HTTP/1.1 Host: www.google.pl Accept: */* Referer: www.google.pl < HTTP/1.1 302 Found < Cache-Control: private < Content-Type: text/html; charset=UTF-8 < Location: http://www.google.com/sorry/?continue=http...owe%26num%3D100 < Content-Length: 300 < Date: Mon, 15 Jul 2013 10:37:48 GMT < Server: GFE/2.0 < * Connection #0 to host www.google.pl left intact * Closing connection #0 * About to connect() to www.google.pl port 80 (#0) * Trying 46.28.247.25... * connected * Connected to www.google.pl (46.28.247.25) port 80 (#0) > GET /search?hl=pl&q=materialy&num=100 HTTP/1.1 Host: www.google.pl Accept: */* Referer: www.google.pl < HTTP/1.1 302 Found < Cache-Control: private < Content-Type: text/html; charset=UTF-8 < Location: http://www.google.com/sorry/?continue=http...aly%26num%3D100 < Content-Length: 300 < Date: Mon, 15 Jul 2013 10:37:49 GMT < Server: GFE/2.0 < * Connection #0 to host www.google.pl left intact * Closing connection #0 Content-type: text/html Array ( [url] => http://ayoa.pl [url_host] => ayoa.pl [0] => Array ( [phrase] => kubki [position] => 0 ) [1] => Array ( [phrase] => reklamowe [position] => 0 ) [2] => Array ( [phrase] => materialy [position] => 0 ) )
">
Malformed header from CGI script: * About to connect() to www.google.pl port 80 (#0) * Trying 46.28.247.25... * connected * Connected to www.google.pl (46.28.247.25) port 80 (#0) > GET /search?hl=pl&q=kubki&num=100 HTTP/1.1 Host: www.google.pl Accept: */* Referer: www.google.pl < HTTP/1.1 302 Found < Cache-Control: private < Content-Type: text/html; charset=UTF-8 < Location: http://www.google.com/sorry/?continue=http...bki%26num%3D100 < Content-Length: 296 < Date: Mon, 15 Jul 2013 10:37:48 GMT < Server: GFE/2.0 < * Connection #0 to host www.google.pl left intact * Closing connection #0 * About to connect() to www.google.pl port 80 (#0) * Trying 46.28.247.25... * connected * Connected to www.google.pl (46.28.247.25) port 80 (#0) > GET /search?hl=pl&q=reklamowe&num=100 HTTP/1.1 Host: www.google.pl Accept: */* Referer: www.google.pl < HTTP/1.1 302 Found < Cache-Control: private < Content-Type: text/html; charset=UTF-8 < Location: http://www.google.com/sorry/?continue=http...owe%26num%3D100 < Content-Length: 300 < Date: Mon, 15 Jul 2013 10:37:48 GMT < Server: GFE/2.0 < * Connection #0 to host www.google.pl left intact * Closing connection #0 * About to connect() to www.google.pl port 80 (#0) * Trying 46.28.247.25... * connected * Connected to www.google.pl (46.28.247.25) port 80 (#0) > GET /search?hl=pl&q=materialy&num=100 HTTP/1.1 Host: www.google.pl Accept: */* Referer: www.google.pl < HTTP/1.1 302 Found < Cache-Control: private < Content-Type: text/html; charset=UTF-8 < Location: http://www.google.com/sorry/?continue=http...aly%26num%3D100 < Content-Length: 300 < Date: Mon, 15 Jul 2013 10:37:49 GMT < Server: GFE/2.0 < * Connection #0 to host www.google.pl left intact * Closing connection #0 Content-type: text/html Array ( [url] => http://ayoa.pl [url_host] => ayoa.pl [0] => Array ( [phrase] => kubki [position] => 0 ) [1] => Array ( [phrase] => reklamowe [position] => 0 ) [2] => Array ( [phrase] => materialy [position] => 0 ) )

Go to the top of the page
+Quote Post
--pikasso--
post
Post #4





Goście







A może znacie inny bardzo prosty skrypt??
chodzi o to, że frazy i adres domeny muszą być wpisane na stałe,
a po odpaleniu wyrzucany jest jedynie wynik:

fraza 1 | pozycja w google
fraza 2 | pozycja w google
fraza 3 | pozycja w google
idt.


Go to the top of the page
+Quote Post
b4rt3kk
post
Post #5





Grupa: Zarejestrowani
Postów: 1 933
Pomógł: 460
Dołączył: 2.04.2010
Skąd: Lublin

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


Nawet tablicy nie umiesz wyświetlić?

  1. <?php
  2. require_once('class.checkPosition.php');
  3.  
  4. $c = new checkPosition( array( 'http://ayoa.pl' ), array( 'kubki', 'reklamowe', 'materialy' ) );
  5. $c->getRank();
  6. $res = $c->getResults();
  7.  
  8. foreach ($res as $key => $value) echo $key . ': ' . $value '<br/>';
  9.  
  10. ?>


--------------------
Jeśli pomogłem, kliknij proszę 'pomógł'. Dzięki.
Go to the top of the page
+Quote Post
sniver
post
Post #6





Grupa: Zarejestrowani
Postów: 159
Pomógł: 5
Dołączył: 31.08.2007

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


chłopakowi dobrze się wyświetliło - tyle że próbuje sprawdzić za dużą ilość fraz.

jak wyskakuje komunikat sorry i coś tam do przepisania (captcha) to znaczy że google zaóważyło że są wysyłane zapytania z automatu. By zweryfikować czy tak jest każe przepisać token.

Jeśli chcesz się pozbyć upierdliwych formularzy o banie lub sankcji na IP - zaplikuj decaptchera oraz jakieś proxy...


--------------------
Go to the top of the page
+Quote Post
--pikasso--
post
Post #7





Goście







Niestety nie ... stąd piszę w dziale przedszkole ...
Próbując podpiąć gotowy skrypt.

Po wpisaniu Twojego kodu mam taki oto błąd:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /System_AYOA/index.php on line 8



Cytat(b4rt3kk @ 15.07.2013, 13:08:32 ) *
Nawet tablicy nie umiesz wyświetlić?

  1. <?php
  2. require_once('class.checkPosition.php');
  3.  
  4. $c = new checkPosition( array( 'http://ayoa.pl' ), array( 'kubki', 'reklamowe', 'materialy' ) );
  5. $c->getRank();
  6. $res = $c->getResults();
  7.  
  8. foreach ($res as $key => $value) echo $key . ': ' . $value '<br/>';
  9.  
  10. ?>

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 Aktualny czas: 20.08.2025 - 21:47