<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>code-diesel &#187; google</title>
	<atom:link href="http://www.codediesel.com/tag/google/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codediesel.com</link>
	<description>/* PHP &#38; MySQL Journal */</description>
	<lastBuildDate>Thu, 02 Feb 2012 13:19:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Google Pagerank in PHP</title>
		<link>http://www.codediesel.com/php/google-pagerank-in-php/</link>
		<comments>http://www.codediesel.com/php/google-pagerank-in-php/#comments</comments>
		<pubDate>Sat, 19 Apr 2008 08:59:08 +0000</pubDate>
		<dc:creator>sameer</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://www.codediesel.com/?p=16</guid>
		<description><![CDATA[Due to recent changes made by Google in its Page Rank processing the following library doesn&#8217;t work. However you can try to use the following api made available by fusionswift.com: http://fusionswift.com/201004/google-pagerank-script-in-php/ Mark Woodman has created a nifty class which lets you query Google pagerank info in PHP 5 and above. The complete classes are available [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>
Due to recent changes made by Google in its Page Rank processing the following library doesn&#8217;t work. However you can try to use the following api made available by fusionswift.com:<br />
<a target="_blank" rel="nofollow" href="http://fusionswift.com/201004/google-pagerank-script-in-php/">http://fusionswift.com/201004/google-pagerank-script-in-php/</a>
</p></blockquote>
<p>Mark Woodman has created a nifty class which lets you query Google pagerank info in PHP 5 and above. The complete classes are available <a title="popStats" href="http://code.google.com/p/popstats/" target="_blank">here</a>.</p>
<p>The minimum classes required are &#8216;<a rel="nofollow" href="http://popstats.googlecode.com/svn/trunk/cacher.class.php">cacher.class.php</a>&#8216; and &#8216;<a rel="nofollow" href="http://popstats.googlecode.com/svn/trunk/google_pagerank.class.php">google_pagerank.class.php</a>&#8216;.</p>
<p>Sample code is shown below.<span id="more-16"></span></p>

<div class="wp_codebox"><table><tr id="p163"><td class="code" id="p16code3"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;popstats/google_pagerank.class.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$rankObject</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> GooglePageRank<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://www.someDomain.com&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$pageRank</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$rankObject</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">pagerank</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">echo</span> <span style="color: #000088;">$pageRank</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>The class also supports result caching on the local machine, so if a second query arrives within the cache time limit the result saved in the local file is returned rather then going out and querying Google.</p>
<p>The &#8216;GooglePageRank&#8217; class accepts cache time as a second parameter. So if you want to cache the result for 6 hours you set the second parameter for 21600 seconds (6 * 60 * 60):</p>

<div class="wp_codebox"><table><tr id="p164"><td class="code" id="p16code4"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$rankObject</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> GooglePageRank<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://www.someDomain.com&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">21600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>The default is set to 24 hours, which is more then adequate for most purposes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codediesel.com/php/google-pagerank-in-php/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
	</channel>
</rss>

