<?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>wpCanyon &#187; php</title>
	<atom:link href="http://wpcanyon.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpcanyon.com</link>
	<description>Wordpress tutorials, articles, hacks, tricks and many more</description>
	<lastBuildDate>Thu, 10 Feb 2011 01:21:37 +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>2 Different Ways For Getting Twitter Status / PHP and jQuery</title>
		<link>http://wpcanyon.com/tipsandtricks/2-different-ways-for-getting-twitter-status-php-and-jquery/</link>
		<comments>http://wpcanyon.com/tipsandtricks/2-different-ways-for-getting-twitter-status-php-and-jquery/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 02:21:03 +0000</pubDate>
		<dc:creator>Boba</dc:creator>
				<category><![CDATA[Tips&Tricks]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[status]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://wpcanyon.com/?p=185</guid>
		<description><![CDATA[Nearly everyone who has a website and a twitter account shows their status on the website. Here are 2 different ways you can use to get the status and show it on your website.]]></description>
			<content:encoded><![CDATA[<h2>PHP</h2>
<p>Place the code bellow inside your theme&#8217;s <strong>function.php</strong> file. Don&#8217;t forget to change the <em>&#8220;TwitterProfileName&#8221;</em> with your twitter profile name.</p>
<pre class="brush: php;">
function parse_feed($feed) {
    $stepOne = explode(&quot;&lt;content type=\&quot;html\&quot;&gt;&quot;, $feed);
    $stepTwo = explode(&quot;&lt;/content&gt;&quot;, $stepOne[1]);
    $tweet = $stepTwo[0];
    $tweet = str_replace(&quot;&amp;lt;&quot;, &quot;&lt;&quot;, $tweet);
    $tweet = str_replace(&quot;&amp;gt;&quot;, &quot;&gt;&quot;, $tweet);
    return $tweet;
}

function getTweet(){
$feed = &quot;http://search.twitter.com/search.atom?q=from:TwitterProfileName&amp;rpp=1&quot;;
$twitterFeed = file_get_contents($feed);
echo parse_feed($twitterFeed);
}
</pre>
<p>Now wherever you like to show the twitter status just call the <strong>getTweet()</strong> function. </p>
<h2>jQuery</h2>
<pre class="brush: jscript;">
$.getJSON(&quot;http://twitter.com/statuses/user_timeline/username.json?callback=?&quot;, function(data) {
     $(&quot;#theIdOfTheElement&quot;).html(data[0].text);
});
</pre>
<p>Change <em>&#8220;#theIdOfTheElement&#8221;</em> with the ID of the element you want to show the twitter status in.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpcanyon.com/tipsandtricks/2-different-ways-for-getting-twitter-status-php-and-jquery/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

