Page 1 of 2

PageRank Plugin

Posted: Sun Sep 17, 2006 6:45 pm
by leonardb
Hello All ...

Strange error when i enabled the pagerank plug in...

Code: Select all

Google PageRank

    * This page:
      Warning: file_get_contents(http://www.google.com/search?client=navclient-auto&ch=6-2147447379&features=Rank&q=info%3Awww.leonarddbernstein.com%2F): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in /home/httpd/www/htdocs/leonarddbernstein.com/plugins/serendipity_plugin_pagerank/serendipity_plugin_pagerank.php on line 209
    * Lenny FX Blog:
      Warning: file_get_contents(http://www.google.com/search?client=navclient-auto&ch=6-1634882589&features=Rank&q=info%3Ahttp%3A%2F%2Fwww.leonarddbernstein.com%2F): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in /home/httpd/www/htdocs/leonarddbernstein.com/plugins/serendipity_plugin_pagerank/serendipity_plugin_pagerank.php on line 209
Page 209 reads

Code: Select all

$data = file_get_contents($url, 128);
Any ideas?

Posted: Sun Sep 17, 2006 7:42 pm
by leonardb
hmmm double posted.. sorry

Posted: Sun Sep 17, 2006 8:22 pm
by carl_galloway
Thanks for letting us know, I deleted your duplicate message.

Carl

Posted: Sun Sep 17, 2006 8:41 pm
by leonardb
No problem.. hopefully I can get some help soon enough . :)

Posted: Mon Sep 18, 2006 2:37 am
by judebert
I believe your server is firewalling outgoing connections. It looks like Serendipity isn't allowed to connect to Google.

You can test this by creating a small PHP file:

Code: Select all

<?php
echo file_get_contents('http://www.google.com/');
?>
Name it something like "fwtest.php", upload it to your server, and call it from your browser. If you see Google, I'm wrong. If you get the error, you need to ask your provider to stop firewalling outgoing connections on port 80.

Posted: Mon Sep 18, 2006 2:47 am
by leonardb
judebert thanks for the help, but i basically have a business account.. all ports unrestricted except by my own routing and my environment is set that this wouldnt be a problem ..

BTW I did try the test file and google came up with no problems..

Thanks though..

Any other ideas?

Posted: Mon Sep 18, 2006 3:01 am
by judebert
Duh; the 403 should've tipped me off.

I copy-and-pasted the URL into my browser window. Google told me I wasn't allowed to access it. Apparently, neither is Serendipity. Unfortunately, they want you to post an entire monstrous checksum thingy to get any help. I'd try doing that first.

However, you may need the checksum from your business server. If you can edit your serendipity_event_pagerank.php, and at line 210, change this

Code: Select all

      if (ini_get('allow_url_fopen')) {
          $data = file_get_contents($url, 128);
      } else {
to this

Code: Select all

      if (ini_get('allow_url_fopen')) {
          $data = file_get_contents($url, 128);
          echo $data;
      } else {
it might print the page data, so you can copy the checksum. I hope.

Posted: Mon Sep 18, 2006 3:18 am
by leonardb
hmmm.. seems to be the same error...

Code: Select all

# This page:
Warning: file_get_contents(http://www.google.com/search?client=navclient-auto&ch=6-2147447379&features=Rank&q=info%3Awww.leonarddbernstein.com%2F): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in /home/httpd/www/htdocs/leonarddbernstein.com/plugins/serendipity_plugin_pagerank/serendipity_plugin_pagerank.php on line 209
# Lenny FX Blog:
Warning: file_get_contents(http://www.google.com/search?client=navclient-auto&ch=6-1634882589&features=Rank&q=info%3Ahttp%3A%2F%2Fwww.leonarddbernstein.com%2F): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in /home/httpd/www/htdocs/leonarddbernstein.com/plugins/serendipity_plugin_pagerank/serendipity_plugin_pagerank.php on line 209
What do you think?

Posted: Mon Sep 18, 2006 4:35 am
by judebert
Rats. I don't really know how to get the contents of the page when there's an error.

Do you get the same problem when you copy-and-paste the URL into your browser window? I got a nicely-formatted 403 page. It has instructions on how to get help from Google. At this point, that's the only thing I can recommend.

Posted: Mon Sep 18, 2006 4:58 am
by leonardb
Well .. I did get an error ..

Code: Select all

Your client does not have permission to get URL /search?client=navclient-auto&ch=6-2147447379&features=Rank&q=info%3Awww.leonarddbernstein.com%2F from this server. (Client IP address: 69.124.148.33)
Here is a portion of the TOS that is interesting..

Code: Select all

No Automated Querying 
You may not send automated queries of any sort to Google's system without express permission in advance from Google. Note that "sending automated queries" includes, among other things: 

using any software which sends queries to Google to determine how a website or webpage "ranks" on Google for various queries; 
"meta-searching" Google; and 
performing "offline" searches on Google.

Please do not write to Google to request permission to "meta-search" Google for a research project, as such requests will not be granted.

so maybe they are denying the request.. google i mean..

Posted: Mon Sep 18, 2006 5:45 am
by judebert
Well, that is what 403 means.

But if that's the case, why do we even have a page ranking plugin? It would seem pretty useless. (Now I've got The Emperor's New Groove stuck in my head: "Why do we even have that lever?")

Posted: Mon Sep 18, 2006 3:07 pm
by leonardb
Wonder if Garvin has any ideas...

Posted: Mon Sep 18, 2006 7:43 pm
by garvinhicking
Hi!

The plugin would need to be modified to use PEARs File_Request method to get to the text of the 403 hidden message.

But, the instructions clearly say automatted fetching is forbidden. Thus the plugin should be removed, as its invalid to use it.

Best regards,
Garvin

Posted: Mon Sep 18, 2006 8:23 pm
by leonardb
Garvin, how are you!?

Well thanks.. I knew i wasnt a retard or anything and what it stated is what it is..

But jude made sense, why is the plugin available if it cant be used..

Its ok anyway, i just removed it.. not a deal breaker.. take care..

Lenny

Posted: Mon Sep 18, 2006 8:34 pm
by judebert
I wouldn't hold my breath: Garvin's on vacation.

Care to enlighten me on what the plugin is supposed to do, anyway?