<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Get Your Most Recent Twitter Status Using&#160;PHP</title>
	<atom:link href="http://abeautifulsite.net/blog/2008/06/get-your-most-recent-twitter-status-using-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://abeautifulsite.net/blog/2008/06/get-your-most-recent-twitter-status-using-php/</link>
	<description></description>
	<lastBuildDate>Thu, 19 Aug 2010 15:49:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: Joel Wallis</title>
		<link>http://abeautifulsite.net/blog/2008/06/get-your-most-recent-twitter-status-using-php/#comment-715</link>
		<dc:creator>Joel Wallis</dc:creator>
		<pubDate>Wed, 10 Jun 2009 06:39:45 +0000</pubDate>
		<guid isPermaLink="false">http://abs.lavitech.com/?p=75#comment-715</guid>
		<description>The Elliot Haughin, a CodeIgniter developer have created a library to use the Twitter API.
It&#039;s a simple class that makes this work easy.

The link:
http://www.haughin.com/code/twitter/</description>
		<content:encoded><![CDATA[<p>The Elliot Haughin, a CodeIgniter developer have created a library to use the Twitter API.<br />
It&#8217;s a simple class that makes this work easy.</p>
<p>The link:<br />
<a href="http://www.haughin.com/code/twitter/" rel="nofollow">http://www.haughin.com/code/twitter/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oto Brglez</title>
		<link>http://abeautifulsite.net/blog/2008/06/get-your-most-recent-twitter-status-using-php/#comment-714</link>
		<dc:creator>Oto Brglez</dc:creator>
		<pubDate>Thu, 28 May 2009 11:32:03 +0000</pubDate>
		<guid isPermaLink="false">http://abs.lavitech.com/?p=75#comment-714</guid>
		<description>This is snippet based on original code above, but it uses JSON and it has counter if you wish to get more than one twit.

&lt;?php

function get_twits($id, $count=5, $links=true){
	$c = curl_init();
	curl_setopt($c, CURLOPT_URL, &quot;http://twitter.com/statuses/user_timeline/&quot;.$id.&quot;.json?count=&quot;.$count);
	curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
	$out = json_decode(curl_exec($c));
	curl_close($c);

	if($links) for($i=0; $i&lt;$count; $i++)
		$out[$i]-&gt;text = ereg_replace(&quot;[[:alpha:]]+://[^&lt;&gt;[:space:]]+[[:alnum:]/]&quot;,
		&quot;&lt;a href=\&quot;\\0\&quot; rel=&quot;nofollow&quot;&gt;\\0&lt;/a&gt;&quot;, $out[$i]-&gt;text);
	return $out;
}

$data = get_twits(&quot;otobrglez&quot;,5);
foreach($data as $twit){
	echo $twit-&gt;text. &quot;\n&quot;;
};

?&gt;</description>
		<content:encoded><![CDATA[<p>This is snippet based on original code above, but it uses JSON and it has counter if you wish to get more than one twit.</p>
<p>< ?php</p>
<p>function get_twits($id, $count=5, $links=true){<br />
	$c = curl_init();<br />
	curl_setopt($c, CURLOPT_URL, "http://twitter.com/statuses/user_timeline/".$id.".json?count=".$count);<br />
	curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);<br />
	$out = json_decode(curl_exec($c));<br />
	curl_close($c);</p>
<p>	if($links) for($i=0; $i<$count; $i++)<br />
		$out[$i]->text = ereg_replace(&#8220;[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]&#8221;,<br />
		&#8220;<a href=\"\\0\" rel="nofollow">\\0</a>&#8220;, $out[$i]->text);<br />
	return $out;<br />
}</p>
<p>$data = get_twits(&#8220;otobrglez&#8221;,5);<br />
foreach($data as $twit){<br />
	echo $twit->text. &#8220;\n&#8221;;<br />
};</p>
<p>?></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff</title>
		<link>http://abeautifulsite.net/blog/2008/06/get-your-most-recent-twitter-status-using-php/#comment-713</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Sat, 23 May 2009 17:00:49 +0000</pubDate>
		<guid isPermaLink="false">http://abs.lavitech.com/?p=75#comment-713</guid>
		<description>James D Fulton, in order to display the time you will have to do antother preg_match like this:
preg_match(&#039;/&lt;created_at&gt;(.*)&lt;\/created_at&gt;/&#039;, $src, $m);
$time = htmlentities($m[1]);

of course then you can take that time and manipulate it with PHP.</description>
		<content:encoded><![CDATA[<p>James D Fulton, in order to display the time you will have to do antother preg_match like this:<br />
preg_match(&#8216;/<created_at>(.*)< \/created_at>/&#8217;, $src, $m);<br />
$time = htmlentities($m[1]);</p>
<p>of course then you can take that time and manipulate it with PHP.</created_at></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rahul</title>
		<link>http://abeautifulsite.net/blog/2008/06/get-your-most-recent-twitter-status-using-php/#comment-712</link>
		<dc:creator>Rahul</dc:creator>
		<pubDate>Wed, 06 May 2009 12:18:17 +0000</pubDate>
		<guid isPermaLink="false">http://abs.lavitech.com/?p=75#comment-712</guid>
		<description>sorry ur code works with xml but not with json... wonder why</description>
		<content:encoded><![CDATA[<p>sorry ur code works with xml but not with json&#8230; wonder why</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rahul</title>
		<link>http://abeautifulsite.net/blog/2008/06/get-your-most-recent-twitter-status-using-php/#comment-711</link>
		<dc:creator>Rahul</dc:creator>
		<pubDate>Wed, 06 May 2009 11:51:29 +0000</pubDate>
		<guid isPermaLink="false">http://abs.lavitech.com/?p=75#comment-711</guid>
		<description>echo preg_replace(&quot;/@([A-Za-z0-9_]+) /&quot;,&quot;&lt;a href=&#039;http://www.twitter.com/$1&#039; rel=&quot;nofollow&quot;&gt;$0&lt;/a&gt;&quot;,$t-&gt;text) . &#039;&lt;br /&gt;&lt;br /&gt;&#039;;

this doesnot work</description>
		<content:encoded><![CDATA[<p>echo preg_replace(&#8220;/@([A-Za-z0-9_]+) /&#8221;,&#8221;<a href='http://www.twitter.com/$1' rel="nofollow">$0</a>&#8220;,$t->text) . &#8216;</p>
<p>&#8216;;</p>
<p>this doesnot work</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Andrews</title>
		<link>http://abeautifulsite.net/blog/2008/06/get-your-most-recent-twitter-status-using-php/#comment-710</link>
		<dc:creator>James Andrews</dc:creator>
		<pubDate>Mon, 13 Apr 2009 03:04:41 +0000</pubDate>
		<guid isPermaLink="false">http://abs.lavitech.com/?p=75#comment-710</guid>
		<description>Neat, but why not just google &quot;php twitter class&quot; and grab one of the many php classes designed to talk to twitter via API calls?  Call it once every 10 minutes and cache the results so you don&#039;t overuse your API call count?</description>
		<content:encoded><![CDATA[<p>Neat, but why not just google &#8220;php twitter class&#8221; and grab one of the many php classes designed to talk to twitter via API calls?  Call it once every 10 minutes and cache the results so you don&#8217;t overuse your API call count?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James D Fulton</title>
		<link>http://abeautifulsite.net/blog/2008/06/get-your-most-recent-twitter-status-using-php/#comment-709</link>
		<dc:creator>James D Fulton</dc:creator>
		<pubDate>Wed, 25 Mar 2009 04:42:25 +0000</pubDate>
		<guid isPermaLink="false">http://abs.lavitech.com/?p=75#comment-709</guid>
		<description>Hi, I&#039;m in need of a bit of help...

I have got the twitter code working on my site and you can see it live at www.jdfulton.com.au

The code im using is:

			&lt;?php
				function twitter_status($twitter_id, $hyperlinks = true) {
					$c = curl_init();
					curl_setopt($c, CURLOPT_URL, &quot;http://twitter.com/statuses/user_timeline/$twitter_id.xml?count=1&quot;);
					curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
					$src = curl_exec($c);
					curl_close($c);
					preg_match(&#039;/&lt;text&gt;(.*)&lt;\/text&gt;/&#039;, $src, $m);
					$status = htmlentities($m[1]);
					if( $hyperlinks ) $status = ereg_replace(&quot;[[:alpha:]]+://[^&lt;&gt;[:space:]]+[[:alnum:]/]&quot;, &quot;&lt;a href=\&quot;\\0\&quot; rel=&quot;nofollow&quot;&gt;\\0&lt;/a&gt;&quot;, $status);
					return($status);
				}
				echo twitter_status(22884262);
			?&gt;


The problem is I want the time the twit was published to be posted as well. I have tried the other codes which are supposed to do that without luck. They have all returned errors.

Any help would be much appreciated, as I said im not to good with PHP

Thanks</description>
		<content:encoded><![CDATA[<p>Hi, I&#8217;m in need of a bit of help&#8230;</p>
<p>I have got the twitter code working on my site and you can see it live at <a href="http://www.jdfulton.com.au" rel="nofollow">http://www.jdfulton.com.au</a></p>
<p>The code im using is:</p>
<p>			< ?php<br />
				function twitter_status($twitter_id, $hyperlinks = true) {<br />
					$c = curl_init();<br />
					curl_setopt($c, CURLOPT_URL, "http://twitter.com/statuses/user_timeline/$twitter_id.xml?count=1");<br />
					curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);<br />
					$src = curl_exec($c);<br />
					curl_close($c);<br />
					preg_match('/<text>(.*)< \/text>/&#8217;, $src, $m);<br />
					$status = htmlentities($m[1]);<br />
					if( $hyperlinks ) $status = ereg_replace(&#8220;[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]&#8221;, &#8220;<a href=\"\\0\" rel="nofollow">\\0</a>&#8220;, $status);<br />
					return($status);<br />
				}<br />
				echo twitter_status(22884262);<br />
			?></p>
<p>The problem is I want the time the twit was published to be posted as well. I have tried the other codes which are supposed to do that without luck. They have all returned errors.</p>
<p>Any help would be much appreciated, as I said im not to good with PHP</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jamie Bicknell</title>
		<link>http://abeautifulsite.net/blog/2008/06/get-your-most-recent-twitter-status-using-php/#comment-708</link>
		<dc:creator>Jamie Bicknell</dc:creator>
		<pubDate>Mon, 23 Mar 2009 09:24:11 +0000</pubDate>
		<guid isPermaLink="false">http://abs.lavitech.com/?p=75#comment-708</guid>
		<description>@Cory: This can happen, I generally use this snippet in an AJAX environment so it will load after the main content of the website loads, therefore not affecting the overall loadtime of the website. You can add in the status check in JS so that if the twitter does lag out, then just stop and try again in 30 seconds or something.</description>
		<content:encoded><![CDATA[<p>@Cory: This can happen, I generally use this snippet in an AJAX environment so it will load after the main content of the website loads, therefore not affecting the overall loadtime of the website. You can add in the status check in JS so that if the twitter does lag out, then just stop and try again in 30 seconds or something.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cory LaViska</title>
		<link>http://abeautifulsite.net/blog/2008/06/get-your-most-recent-twitter-status-using-php/#comment-707</link>
		<dc:creator>Cory LaViska</dc:creator>
		<pubDate>Sun, 22 Mar 2009 21:34:27 +0000</pubDate>
		<guid isPermaLink="false">http://abs.lavitech.com/?p=75#comment-707</guid>
		<description>@Jamie: There&#039;s only one thing I noticed about this...sometimes it hangs (when Twitter lags?) and thus the remainder of the page fails to load if you call it inline.  I actually had to remove the status from ABS because of this.</description>
		<content:encoded><![CDATA[<p>@Jamie: There&#8217;s only one thing I noticed about this&#8230;sometimes it hangs (when Twitter lags?) and thus the remainder of the page fails to load if you call it inline.  I actually had to remove the status from ABS because of this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jamie Bicknell</title>
		<link>http://abeautifulsite.net/blog/2008/06/get-your-most-recent-twitter-status-using-php/#comment-706</link>
		<dc:creator>Jamie Bicknell</dc:creator>
		<pubDate>Fri, 20 Mar 2009 16:08:20 +0000</pubDate>
		<guid isPermaLink="false">http://abs.lavitech.com/?p=75#comment-706</guid>
		<description>@James Stone - I would only use the code I stated on the 28th Jan to display a single status. For multiple statuses see code below.

@John - Possibly two things I don&#039;t like about that code. First, the @ suppresses errors and makes the code around 10x slower even if it is a success. Secondly, that ereg_replace function is a bit slow. I always prefer preg_replace over ereg, but that&#039;s just me. You can adjust that for preg_replace no worries. Also, dont forget that when someone tweets a reply, the @jamiebicknell also needs to be a link, see my code below for the preg_replace.

$id = &quot;jamiebicknell&quot;;
$tweet = new SimpleXMLElement(&#039;http://twitter.com/statuses/user_timeline/&#039;.urlencode($id).&#039;.xml?count=5&#039;,NULL,TRUE);
foreach($tweet-&gt;status as $t) {
    echo preg_replace(&quot;/@([A-Za-z0-9_]+) /&quot;,&quot;&lt;a href=&#039;http://www.twitter.com/$1&#039; rel=&quot;nofollow&quot;&gt;$0&lt;/a&gt;&quot;,$t-&gt;text) . &#039;&lt;br /&gt;&lt;br /&gt;&#039;;
}</description>
		<content:encoded><![CDATA[<p>@James Stone &#8211; I would only use the code I stated on the 28th Jan to display a single status. For multiple statuses see code below.</p>
<p>@John &#8211; Possibly two things I don&#8217;t like about that code. First, the @ suppresses errors and makes the code around 10x slower even if it is a success. Secondly, that ereg_replace function is a bit slow. I always prefer preg_replace over ereg, but that&#8217;s just me. You can adjust that for preg_replace no worries. Also, dont forget that when someone tweets a reply, the @jamiebicknell also needs to be a link, see my code below for the preg_replace.</p>
<p>$id = &#8220;jamiebicknell&#8221;;<br />
$tweet = new SimpleXMLElement(&#8216;http://twitter.com/statuses/user_timeline/&#8217;.urlencode($id).&#8217;.xml?count=5&#8242;,NULL,TRUE);<br />
foreach($tweet->status as $t) {<br />
    echo preg_replace(&#8220;/@([A-Za-z0-9_]+) /&#8221;,&#8221;<a href='http://www.twitter.com/$1' rel="nofollow">$0</a>&#8220;,$t->text) . &#8216;</p>
<p>&#8216;;<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->