<?php

App::import('Vendor', 'cURL', array ( 'file' => 'curl.php'));

class GooglePagerankComponent extends Object {

	public $criteriumId = 1;
	
	function getRank($url)
	{	
		$fp = FirePHP::getInstance(true);
		$curl = new cURL();
		
		$GooglePageRankURL = 'http://www.google.com/search?client=navclient-auto&ch=6-1484155081&features=Rank&q=info:'.$url;
		$content = $curl->get($GooglePageRankURL);
		preg_match('/[0-9]+$/', $content, $matches);
		$googlePageRank = $matches[0];
		$fp->log($googlePageRank, 'Google Pagerank');
		
		return $googlePageRank;
	}
	
}

?>