Sep 02 2008

Getting Pagerank of Websites through PHP

Published by Gaurav Mishra at 7:41 pm under programming

Google is today one of the most important website in world wide web, Google search result has become one of the most important services for world wide web users.

A full fledged SEO industry is running on the google pagerank algorithm decided by Google Inc

I have seen a lot of developers asking the method of getting google pageranks and baclinks with the help of php.

The Google search results are ranked by page rank.

We are going to use Php class “Google PR” from Phpclasses.org

Download the Class file from here

<?php

//Include and initiate the class this line tutorial assumes that this code and class are situated in same folder

include_once(“class.googlepr.php”);

//initate a  new object

$rank = new GooglePR();


//Query the pagerank of website

echo “PageRank : ” .$gpr->GetPR(“http://www.mrdbs.com/”) .“\n”;

?>

2 Responses to “Getting Pagerank of Websites through PHP”

  1. Shantanu Goel INDIA Linux Mozilla Firefox 3.0.1 on 02 Sep 2008 at 8:13 pm

    Gaurav, do those classes carry out some calculations based on the search results etc or they directly query the google database or something?

    Sidenote: I don’t think its possible to download a php file that ways, you’d have to zip it up. or maybe it is possible since WP guys explicitly have an option to move the wp-config.php files out of the web accessible paths now. But certainly not easy or straight forward.

  2. Gaurav Mishra INDIA Windows XP Mozilla Firefox 3.0.1 on 02 Sep 2008 at 8:37 pm

    @Shantanu

    This class produce a checksum from the google search results and compute pagerank from it.

    Thanks for pointing it out, Edited the post with correct download file.

    I actually started to look for ranking algos to make this

    http://hindihosting.com/rank/?site=gauravmishra.info

    And found that there were numerous posts on web asking method of computing pagerank through php. But no answer.

    So thought of posting it :)

Trackback URI | Comments RSS

Leave a Reply

FireStats icon Powered by FireStats