<?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>Shane Jones &#187; PHP</title>
	<atom:link href="http://www.shanejones.co.uk/publications/category/work/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shanejones.co.uk</link>
	<description></description>
	<lastBuildDate>Mon, 10 Oct 2011 14:20:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Pulling recent hashtags from twitter</title>
		<link>http://www.shanejones.co.uk/php/pulling-recent-hashtags-from-twitter-3/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=pulling-recent-hashtags-from-twitter</link>
		<comments>http://www.shanejones.co.uk/php/pulling-recent-hashtags-from-twitter-3/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 20:42:08 +0000</pubDate>
		<dc:creator>Shane Jones</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Twitter Dev]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://www.shanejones.co.uk/wp/?p=3</guid>
		<description><![CDATA[This code pulls a json of a hashtag search from twitter. It runs some functions to add to a database. (functions not included.)]]></description>
			<content:encoded><![CDATA[<p>This code pulls a json of a hashtag search from twitter. It runs some functions to add to a database. (functions not included.) </p>
<pre class="brush: php; title: ; notranslate">
global $total, $hashtag;

$hashtag = '#somehashtag';
$total = 0;

function getTweets($hash_tag, $page) {
	global $total, $hashtag;
	$url = 'http://search.twitter.com/search.json?q='.urlencode($hash_tag).'&amp;';
	$url .= 'page='.$page;
	$ch = curl_init($url);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
	$json = curl_exec($ch);
	curl_close ($ch);

	$json_decode = json_decode($json);

	$json_output = json_decode($json,true);

	for($c=0;$c&lt;=count($json_decode-&gt;results);$c++){
		if(isset($json_output['results'][$c]['id_str'])){
			if(!tweet_exists($json_output['results'][$c]['id_str'])){
				add_tweet($json_output['results'][$c]['id_str'],
						  $json_output['results'][$c]['from_user'],
						  $json_output['results'][$c]['created_at'],
						  $json_output['results'][$c]['profile_image_url'],
						  $json_output['results'][$c]['text']);
			}
		}
	}

	if($json_decode-&gt;next_page){
		$temp = explode(&quot;&amp;&quot;,$json_decode-&gt;next_page);
		$p = explode(&quot;=&quot;,$temp[0]);
		getTweets($hashtag,$p[1]);
	}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.shanejones.co.uk/php/pulling-recent-hashtags-from-twitter-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Displaying RSS Items using PHP</title>
		<link>http://www.shanejones.co.uk/php/displaying-rss-items-using-php-24/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=displaying-rss-items-using-php</link>
		<comments>http://www.shanejones.co.uk/php/displaying-rss-items-using-php-24/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 12:38:25 +0000</pubDate>
		<dc:creator>Shane Jones</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[RSS]]></category>

		<guid isPermaLink="false">http://www.shanejones.co.uk/wp/?p=24</guid>
		<description><![CDATA[This script parses an RSS file and displays the items in a list. The script should be encased by a ordered or unordered list tag]]></description>
			<content:encoded><![CDATA[<p>This script parses an RSS file and displays the items in a list.<span id="more-24"></span> The script should be encased by a ordered or unordered list tag</p>
<pre class="brush: php; title: ; notranslate">&lt;?php
	$rss_url = &quot;http://feedity.com/rss.aspx/google-com/UVRSWlpQ&quot;;
	if (!$rss_data = @file_get_contents($rss_url)) {
		echo &quot;&lt;li&gt;Seems we're having a hard time finding that RSS, it'll be back soon!&lt;/li&gt;&quot;;
	} else {

	$rss_xml = SimpleXML_Load_String($rss_data);

	$channel_title = $rss_xml-&gt;channel-&gt;title;
	$channel_link = $rss_xml-&gt;channel-&gt;link;

	foreach ($rss_xml-&gt;channel-&gt;item as $item) {
		$item_title = $item-&gt;title;
		$item_link = $item-&gt;link;
		echo &quot;&lt;li&gt;$item_title - &lt;a href=\&quot;$item_link\&quot; target=\&quot;_blank\&quot;&gt;view article&lt;/a&gt;&lt;/li&gt;\n&quot;;
		}
	}
?&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.shanejones.co.uk/php/displaying-rss-items-using-php-24/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

