<?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>Open Source Web &#187; simpleXML</title>
	<atom:link href="http://www.open-source-web.com/tag/simplexml/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.open-source-web.com</link>
	<description>Your open source for Development and Design</description>
	<lastBuildDate>Sun, 08 Jan 2012 10:21:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Twitter PHP and SimpleXML feed</title>
		<link>http://www.open-source-web.com/apis/twitter-php-and-simplexml-feed/</link>
		<comments>http://www.open-source-web.com/apis/twitter-php-and-simplexml-feed/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 20:45:04 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[API's]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[simpleXML]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=136</guid>
		<description><![CDATA[Just like the Google Charts API the Twitter API can be super simple. Twitter uses a few different XML feeds to send and receive data from a given user, some feeds require a user name and password supplied through Curl but a few are publicly available to all. This example will use the built in [...]]]></description>
			<content:encoded><![CDATA[<p>Just like the <a href="http://www.open-source-web.com/php/google-charts-example/">Google Charts API</a> the Twitter API can be super simple. Twitter uses a few different XML feeds to send and receive data from a given user, some feeds require a user name and password supplied through Curl but a few are publicly available to all.</p>
<p>This example will use the built in SimpleXML functions which come with PHP5, this is a much faster and easier way to using alternative readers such as simplePie or anything else you might come across. As far as it goes I don&#8217;t think SimpleXML gets enough coverage so I am happy to put it to some use for this example.</p>
<p>Keeping it basic</p>
<p>&lt;?php</p>
<p>$xml = simplexml_load_file(&#8220;http://twitter.com/statuses/user_timeline/adi182.xml?count=2&#8243;);<br />
if($xml){<br />
echo &#8216;&lt;h3&gt;&lt;a href=&#8221;http://www.twitter.com/adi182&#8243;&gt;Latest Tweets&lt;/a&gt;&lt;/h3&gt;<br />
&lt;ul&gt;&#8217;;<br />
foreach($xml-&gt;status as $tweet){<br />
$description = $tweet-&gt;text;<br />
echo &#8216;&lt;li&gt;&#8217;.$description.&#8217;&lt;/li&gt;&#8217;;<br />
}<br />
echo &#8216; &lt;/ul&gt;&#8217;;<br />
}<br />
?&gt;</p>
<p>So there you have it, the super simple example on putting a Twiter feed on your website.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/apis/twitter-php-and-simplexml-feed/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

