<?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>ajgraham.com &#187; API</title>
	<atom:link href="http://www.ajgraham.com/tag/api/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ajgraham.com</link>
	<description>web design, development and consultation in Prague</description>
	<lastBuildDate>Fri, 02 Jul 2010 21:55:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Retrieve Facebook page status with no authenticating or permissions issues</title>
		<link>http://www.ajgraham.com/2010/07/get-facebook-page-stream-simple-easy/</link>
		<comments>http://www.ajgraham.com/2010/07/get-facebook-page-stream-simple-easy/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 21:42:11 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[auth]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[get]]></category>
		<category><![CDATA[key]]></category>
		<category><![CDATA[read]]></category>
		<category><![CDATA[retrieve]]></category>
		<category><![CDATA[RSS]]></category>
		<category><![CDATA[scraping]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[status]]></category>
		<category><![CDATA[stream]]></category>

		<guid isPermaLink="false">http://www.ajgraham.com/?p=451</guid>
		<description><![CDATA[If you&#8217;re just looking to read the &#8216;Stream&#8217; or &#8216;Statuses&#8217; of a Facebook fan page (not a normal Profile page) it can be done very easily. Due to all Fan Pages being public (their are 2 settings: published or unpublished), as long as the Fan page is published then you [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re just looking to read the &#8216;Stream&#8217; or &#8216;Statuses&#8217; of a Facebook fan page (<em>not</em> a normal Profile page) it can be done very easily. Due to all Fan Pages being public (their are 2 settings: published or unpublished), as long as the Fan page is published then you can retrieve any data from it, no authentication, no API, no messing around.</p>
<p>Step 1 &#8211; Find the page feed for the Fan Page<br />
The basic URL format of a Facebook fan page feed is:</p>
<pre><code>https://graph.facebook.com/ID of Page/feed</code></pre>
<p>If you can&#8217;t find your unique Page ID <a target="_blank" rel="nofollow" href="http://help.wildfireapp.com/faqs/tutorials/how-to-find-out-your-facebook-fan-page-public-profile-id">read this guide</a>.<br />
<a target="_blank" rel="nofollow" href="https://graph.facebook.com/ID of Page/feed">Test it by opening the link in another browser window</a>. If you get a whole load of data in square and curly brackets (it&#8217;s JSON) that contains posts from your fan page then you&#8217;re set for Step 2.</p>
<p>*Please note that this URL gets every post from your Wall/Stream limited to about the 50 most recent from what I&#8217;ve seen. This includes everything that other people have posted as well in the form of their posts or comments, etc.</p>
<p>Step 2 &#8211; Extract the last status from the feed URL data</p>
<p>Here comes the basic PHP code, you need to put in the Page ID for the
<pre><code>$pageID</code></pre>
<p> variable:</p>
<pre><code>$pageID = "ID of Page"
$url = "https://graph.facebook.com/". $pageID ."/feed";
$json = file_get_contents($url);
$jsonData = json_decode($json);

foreach($jsonData->data as $val) {
	if($val->from->id == $pageID) { //find the first matching post/status by a fan page admin
		$message = $val->message;
		echo $message;
		break; //stop looping on most recent status posted by page admin
	}
}</code></pre>
<h3>Things to consider</h3>
<p>Extracting the data from Facebook directly using a server-side approach should not be used for production as it&#8217;s really inefficient as it adds a noticeable pause to page loading times and will break if Facebook is slow in responding. I provided a basic demo to show how easy it can be done, but you should expand on this by storing the data extracted in a database or file on your server via CRON jobs. Another alternative would be to do it client-side with JavaScript, it depends on the frequency the Fan page data you want is expected to change and what you&#8217;re doing with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ajgraham.com/2010/07/get-facebook-page-stream-simple-easy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Maps and Charts: Visited Countries/States</title>
		<link>http://www.ajgraham.com/2009/10/google-maps-visited-countriesstates/</link>
		<comments>http://www.ajgraham.com/2009/10/google-maps-visited-countriesstates/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 13:00:26 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[countries]]></category>
		<category><![CDATA[generate]]></category>
		<category><![CDATA[Google charts]]></category>
		<category><![CDATA[Google maps]]></category>
		<category><![CDATA[states]]></category>

		<guid isPermaLink="false">http://ajgraham.com/?p=69</guid>
		<description><![CDATA[I found a nifty little Google Maps implementation that enables you to mark which countries you&#8217;ve visited from Douwe Osinga&#8217;s blog
I clearly need to get out more. A lot more.
visited 4 states (1.77%)
]]></description>
			<content:encoded><![CDATA[<p>I found a nifty little Google Maps implementation that enables you to mark which countries you&#8217;ve visited from <a href="http://douweosinga.com/projects/visited?region=world">Douwe Osinga&#8217;s blog</a></p>
<p>I clearly need to get out more. A lot more.</p>
<p><img src="http://chart.apis.google.com/chart?cht=t&#038;chs=440x220&#038;chtm=world&#038;chf=bg,s,336699&#038;chco=d0d0d0,cc0000&#038;chd=s:9999&#038;chld=GBESQIIE" width="440" height="220" ><br/>visited 4 states (1.77%)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ajgraham.com/2009/10/google-maps-visited-countriesstates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The problem with using the Google Maps API for UK addresses</title>
		<link>http://www.ajgraham.com/2009/09/the-problem-with-using-the-google-maps-api-for-uk-addresses/</link>
		<comments>http://www.ajgraham.com/2009/09/the-problem-with-using-the-google-maps-api-for-uk-addresses/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 16:59:23 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[address]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[British]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[maps]]></category>
		<category><![CDATA[UK]]></category>

		<guid isPermaLink="false">http://ajgraham.com/?p=17</guid>
		<description><![CDATA[I love the Google Maps API. Except when using it for UK based addresses. There is a big problem with any app created using the Google Maps API &#8211; UK postcodes will NOT be processed, worse still, they return errors.
To give some background on the issue, The Royal Mail own [...]]]></description>
			<content:encoded><![CDATA[<p>I love the Google Maps API. Except when using it for UK based addresses. There is a big problem with any app created using the Google Maps API &#8211; UK postcodes will <em>NOT</em> be processed, worse still, they return errors.</p>
<p>To give some background on the issue, The Royal Mail own the copywrite for the <acronym title="Postcode Address Finder">PAF</acronym> (Postcode Address File) as its called and charge anyone who wants to access it. You&#8217;re probably thinking &#8220;but I&#8217;ve used postcodes on Google Maps lots of times before&#8230;.&#8221; and you&#8217;d be right. The problem emerges as Google refuses (in my opinion rightly so) to pay for its API to access the PAF (see <a href="http://www.guardian.co.uk/technology/2007/apr/26/freeourdata.guardianweeklytechnologysection">background information</a>), which means that anyone using the Google Maps API for UK purposes is severely handicapped by its limitations from a usability and functionality point of view. What really rubs salt into the wounds is that almost every other major country has there post/zipcode data available freely.</p>
<p>So until this ridiculous situation is fixed, API developers using the Maps API for UK purposes will have plenty of headaches.</p>
<p><strong>Update 9/12/2009</strong>: UK Postcode data will finally be free in April 2010, source: <a href="http://news.bbc.co.uk/1/hi/technology/8402327.stm">http://news.bbc.co.uk/1/hi/technology/8402327.stm</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ajgraham.com/2009/09/the-problem-with-using-the-google-maps-api-for-uk-addresses/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
