PageRank Plugin

Creating and modifying plugins.
leonardb
Regular
Posts: 53
Joined: Fri Jan 14, 2005 10:27 pm

PageRank Plugin

Post 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?
leonardb
Regular
Posts: 53
Joined: Fri Jan 14, 2005 10:27 pm

Post by leonardb »

hmmm double posted.. sorry
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

Thanks for letting us know, I deleted your duplicate message.

Carl
leonardb
Regular
Posts: 53
Joined: Fri Jan 14, 2005 10:27 pm

Post by leonardb »

No problem.. hopefully I can get some help soon enough . :)
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post 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.
Judebert
---
Website | Wishlist | PayPal
leonardb
Regular
Posts: 53
Joined: Fri Jan 14, 2005 10:27 pm

Post 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?
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post 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.
Judebert
---
Website | Wishlist | PayPal
leonardb
Regular
Posts: 53
Joined: Fri Jan 14, 2005 10:27 pm

Post 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?
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post 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.
Judebert
---
Website | Wishlist | PayPal
leonardb
Regular
Posts: 53
Joined: Fri Jan 14, 2005 10:27 pm

Post 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..
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post 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?")
Judebert
---
Website | Wishlist | PayPal
leonardb
Regular
Posts: 53
Joined: Fri Jan 14, 2005 10:27 pm

Post by leonardb »

Wonder if Garvin has any ideas...
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
leonardb
Regular
Posts: 53
Joined: Fri Jan 14, 2005 10:27 pm

Post 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
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post 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?
Judebert
---
Website | Wishlist | PayPal
Post Reply