<?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>Happy Chimp &#187; cron</title>
	<atom:link href="http://happychimp.co.uk/tag/cron/feed/" rel="self" type="application/rss+xml" />
	<link>http://happychimp.co.uk</link>
	<description>Another Xbox 360 gaming blog of yawntastic proportions...™</description>
	<lastBuildDate>Fri, 03 Apr 2009 09:13:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Xbox Live XML feed</title>
		<link>http://happychimp.co.uk/28032009/xbox-live-xml-feed/</link>
		<comments>http://happychimp.co.uk/28032009/xbox-live-xml-feed/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 13:38:42 +0000</pubDate>
		<dc:creator>Happy Chimp</dc:creator>
				<category><![CDATA[Site development]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[xbox]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://happychimp.co.uk/?p=15</guid>
		<description><![CDATA[As part of my new WordPress theme, I&#8217;ve added a basic Xbox Live XML feed processor; it&#8217;s basically doing the following: A PHP script running via a cron job (outside of my web directory) grabs an Xbox Live XML data feed from Duncan Mackenzie&#8217;s site (my raw feed). I then extract the few bits of [...]]]></description>
			<content:encoded><![CDATA[<p>As part of my new WordPress theme, I&#8217;ve added a basic Xbox Live XML feed processor; it&#8217;s basically doing the following:</p>
<ul>
<li>A PHP script running via a cron job (outside of my web directory) grabs an Xbox Live XML data feed from <a href="http://duncanmackenzie.net/Blog/put-up-a-rest-api-for-xbox-gamertag-data">Duncan Mackenzie&#8217;s</a> site (my <a href="http://duncanmackenzie.net/services/GetXboxInfo.aspx?GamerTag=Happy%20Chimp">raw feed</a>).</li>
<li>I then extract the few bits of data I want to keep using the in-built PHP <a href="http://uk.php.net/manual/en/intro.simplexml.php">SimpleXML</a> extension, (I&#8217;m just grabbing my Gamerscore and status info for the moment) and then dumps it into a MySQL database.</li>
<li>The WordPress front-end will then query the database on each page load rather than hammering the raw feed directly (this <em>should </em>hopefully save Duncan some bandwidth, plus if the feed ever falls over, I&#8217;ve still got some usable data kicking around).</li>
<li>The cron job runs every 30 minutes or so (it was running every 2hrs or so while testing) &#8211; if the last update time is over 30mins then there&#8217;s something dodgy with the feed. Oh yeah, I&#8217;m using cPanel 11, which makes setting up a <a href="http://www.2serveu.net/cpanel-tutorials/standardcron.html">cron job</a> to run a <a href="http://www.webmasterworld.com/forum88/6102.htm">PHP script</a> a breeze.</li>
</ul>
<p>Admittedly there&#8217;s nothing very complicated going on, but getting it working without too much fuss deserves some lovely achievement points I think <img src='http://happychimp.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p style="text-align: center;"><img class="size-full wp-image-23 aligncenter" title="Achievement Unlocked" src="http://happychimp.co.uk/wp-content/uploads/2009/03/achievement.jpg" alt="achievement" width="422" height="77" /></p>
<p>In the future I&#8217;ll probably look at using some of the available game data, but this is enough to keep me going for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://happychimp.co.uk/28032009/xbox-live-xml-feed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

