<?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: How to Get Your Most Recent Twitter Posts Using PHP with&#160;Caching</title> <atom:link href="http://spaceninja.com/2009/07/twitter-php-caching/feed/" rel="self" type="application/rss+xml" /><link>http://spaceninja.com/2009/07/twitter-php-caching/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=twitter-php-caching</link> <description>CSS ninja, last of the freelance hackers, greatest swordfighter in the world</description> <lastBuildDate>Tue, 08 May 2012 17:22:29 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>By: Pete Leonard</title><link>http://spaceninja.com/2009/07/twitter-php-caching/#comment-215006</link> <dc:creator>Pete Leonard</dc:creator> <pubDate>Sun, 07 Aug 2011 21:44:51 +0000</pubDate> <guid
isPermaLink="false">http://spaceninja.com/?p=3993#comment-215006</guid> <description>Not very elegant but you can use this code straight after the for loop to get the link address of the status.
$clean_link_1 = explode(&quot;:&quot;, $clean[$i]);
$linklen = strlen($clean_link_1[2]);
$id = substr($clean_link_1[2], 0, ($linklen - 13));
$id = str_replace(&quot;&quot;, &quot;&quot;, $id);
$link = &quot;http://twitter.com/#!/$username_for_feed/statuses/$id&quot;;</description> <content:encoded><![CDATA[<p>Not very elegant but you can use this code straight after the for loop to get the link address of the status.</p><p>$clean_link_1 = explode(&#8220;:&#8221;, $clean[$i]);<br
/> $linklen = strlen($clean_link_1[2]);<br
/> $id = substr($clean_link_1[2], 0, ($linklen &#8211; 13));<br
/> $id = str_replace(&#8220;&#8221;, &#8220;&#8221;, $id);<br
/> $link = &#8220;http://twitter.com/#!/$username_for_feed/statuses/$id&#8221;;</p> ]]></content:encoded> </item> <item><title>By: Luke</title><link>http://spaceninja.com/2009/07/twitter-php-caching/#comment-212087</link> <dc:creator>Luke</dc:creator> <pubDate>Sun, 31 Jul 2011 13:58:59 +0000</pubDate> <guid
isPermaLink="false">http://spaceninja.com/?p=3993#comment-212087</guid> <description>I&#039;ve been trying for hours to get the profile image url from the  href with no luck. Any ideas on how to grab that?</description> <content:encoded><![CDATA[<p>I&#8217;ve been trying for hours to get the profile image url from the  href with no luck. Any ideas on how to grab that?</p> ]]></content:encoded> </item> <item><title>By: Dave</title><link>http://spaceninja.com/2009/07/twitter-php-caching/#comment-204788</link> <dc:creator>Dave</dc:creator> <pubDate>Sun, 17 Jul 2011 21:59:54 +0000</pubDate> <guid
isPermaLink="false">http://spaceninja.com/?p=3993#comment-204788</guid> <description>good catch - found the same thing myself.  Just to clarify - this is an *important* fix to pass W3C XHTML strict validation.  Not fixing it leaves a small script call in  hashtag links mangled with improper quoting.</description> <content:encoded><![CDATA[<p>good catch &#8211; found the same thing myself.  Just to clarify &#8211; this is an *important* fix to pass W3C XHTML strict validation.  Not fixing it leaves a small script call in  hashtag links mangled with improper quoting.</p> ]]></content:encoded> </item> <item><title>By: Sisir</title><link>http://spaceninja.com/2009/07/twitter-php-caching/#comment-172621</link> <dc:creator>Sisir</dc:creator> <pubDate>Sun, 01 May 2011 10:50:37 +0000</pubDate> <guid
isPermaLink="false">http://spaceninja.com/?p=3993#comment-172621</guid> <description>Hi, i am getting problem. The scripts is loading only 3 tweets in my case. But i put the limit to 10. Please help. Thanks!</description> <content:encoded><![CDATA[<p>Hi, i am getting problem. The scripts is loading only 3 tweets in my case. But i put the limit to 10. Please help. Thanks!</p> ]]></content:encoded> </item> <item><title>By: James Hobson</title><link>http://spaceninja.com/2009/07/twitter-php-caching/#comment-172616</link> <dc:creator>James Hobson</dc:creator> <pubDate>Sun, 01 May 2011 10:42:40 +0000</pubDate> <guid
isPermaLink="false">http://spaceninja.com/?p=3993#comment-172616</guid> <description>Hi, I&#039;ve found a validation issue with links within tweets due to lack of quotation marks.
the line:
[php]$clean = str_replace(&quot;&quot;&quot;, &quot;&#039;&quot;, $clean);[/php]
needs to be replaced with:
[php]$clean = str_replace(&quot;&quot;&quot;, &quot;\&quot;&quot;, $clean);[/php]
Cheers,
James</description> <content:encoded><![CDATA[<p>Hi, I&#8217;ve found a validation issue with links within tweets due to lack of quotation marks.<br
/> the line:</p><pre class="brush: php; title: ; notranslate">$clean = str_replace(&quot;&amp;quot;&quot;, &quot;'&quot;, $clean);</pre><p>needs to be replaced with:</p><pre class="brush: php; title: ; notranslate">$clean = str_replace(&quot;&amp;quot;&quot;, &quot;\&quot;&quot;, $clean);</pre><p>Cheers,<br
/> James</p> ]]></content:encoded> </item> <item><title>By: Sisir</title><link>http://spaceninja.com/2009/07/twitter-php-caching/#comment-171340</link> <dc:creator>Sisir</dc:creator> <pubDate>Fri, 29 Apr 2011 14:55:00 +0000</pubDate> <guid
isPermaLink="false">http://spaceninja.com/?p=3993#comment-171340</guid> <description>[php]$delta = strtotime(&#039;+2 hours&#039;) - $time;[/php]
Shifts the time 2 hours.
Also it only loading 3 tweets but i set the limit to 10. </description> <content:encoded><![CDATA[<pre class="brush: php; title: ; notranslate">$delta = strtotime('+2 hours') - $time;</pre><p>Shifts the time 2 hours.</p><p>Also it only loading 3 tweets but i set the limit to 10.</p> ]]></content:encoded> </item> <item><title>By: redflame</title><link>http://spaceninja.com/2009/07/twitter-php-caching/#comment-162531</link> <dc:creator>redflame</dc:creator> <pubDate>Sat, 09 Apr 2011 21:44:51 +0000</pubDate> <guid
isPermaLink="false">http://spaceninja.com/?p=3993#comment-162531</guid> <description>this is awesome! thank you!
quick question is there anyway to link the time to the actual twitter post?
i see the post referenced within the id tag - it just needs to get appended to the following:
http://twitter.com/username/statuses/$id
thanks for any help</description> <content:encoded><![CDATA[<p>this is awesome! thank you!</p><p>quick question is there anyway to link the time to the actual twitter post?</p><p>i see the post referenced within the id tag &#8211; it just needs to get appended to the following:</p><p><a
href="http://twitter.com/username/statuses/$id" rel="nofollow">http://twitter.com/username/statuses/$id</a></p><p>thanks for any help</p> ]]></content:encoded> </item> <item><title>By: James Hobson</title><link>http://spaceninja.com/2009/07/twitter-php-caching/#comment-159773</link> <dc:creator>James Hobson</dc:creator> <pubDate>Sun, 03 Apr 2011 10:35:24 +0000</pubDate> <guid
isPermaLink="false">http://spaceninja.com/?p=3993#comment-159773</guid> <description>Many thanks for the script. I was having &#039;could not connect to twitter&#039; 9 times out of 10 (or so it seemed) with Twitter Widget Pro for WordPress and an unhappy client.
Found your script and implemented it.
Was only when I created a &#039;cache&#039; folder did it start to work properly.
Great work.</description> <content:encoded><![CDATA[<p>Many thanks for the script. I was having &#8216;could not connect to twitter&#8217; 9 times out of 10 (or so it seemed) with Twitter Widget Pro for WordPress and an unhappy client.<br
/> Found your script and implemented it.<br
/> Was only when I created a &#8216;cache&#8217; folder did it start to work properly.<br
/> Great work.</p> ]]></content:encoded> </item> <item><title>By: John</title><link>http://spaceninja.com/2009/07/twitter-php-caching/#comment-133238</link> <dc:creator>John</dc:creator> <pubDate>Thu, 20 Jan 2011 11:29:44 +0000</pubDate> <guid
isPermaLink="false">http://spaceninja.com/?p=3993#comment-133238</guid> <description>Hi Scott,
Thank you for that - I didn&#039;t intend for you to spend any time on it!
One thing I had noticed (and will be exploring next) is that all of the @reply tweets start with:
&lt;code&gt;&lt;a href=&quot;http://twitter.com/...&lt;/code&gt;
So it&#039;s probably possible to do a string-match against the first few characters of the returned tweets and discard any that match that pattern.
It does fall foul of a couple of fringe cases though:
1) It relies on Twitter not changing the format of their feed
2) It also means that should you start a Tweet with a link within the Twitter domain (eg: if you linked to the &#039;new Twitter&#039; page here http://twitter.com/newtwitter), AND you didn&#039;t use a URL shortening service, AND it was the very first characters in your tweet, it would also get discarded.
All limitations I reckon I could live with!
I&#039;m going to ask a friend of mine who&#039;s far more into his PHP than I am to have a look, maybe it will be possible to get rid of @replies just by detecting the first few characters..</description> <content:encoded><![CDATA[<p>Hi Scott,</p><p>Thank you for that &#8211; I didn&#8217;t intend for you to spend any time on it!</p><p>One thing I had noticed (and will be exploring next) is that all of the @reply tweets start with:</p><p><code>&lt;a href="http://twitter.com/...</code></p><p>So it&#8217;s probably possible to do a string-match against the first few characters of the returned tweets and discard any that match that pattern.</p><p>It does fall foul of a couple of fringe cases though:</p><p>1) It relies on Twitter not changing the format of their feed</p><p>2) It also means that should you start a Tweet with a link within the Twitter domain (eg: if you linked to the &#8216;new Twitter&#8217; page here <a
href="http://twitter.com/newtwitter" rel="nofollow">http://twitter.com/newtwitter</a>), AND you didn&#8217;t use a URL shortening service, AND it was the very first characters in your tweet, it would also get discarded.</p><p>All limitations I reckon I could live with!</p><p>I&#8217;m going to ask a friend of mine who&#8217;s far more into his PHP than I am to have a look, maybe it will be possible to get rid of @replies just by detecting the first few characters..</p> ]]></content:encoded> </item> <item><title>By: Scott</title><link>http://spaceninja.com/2009/07/twitter-php-caching/#comment-133120</link> <dc:creator>Scott</dc:creator> <pubDate>Thu, 20 Jan 2011 05:01:51 +0000</pubDate> <guid
isPermaLink="false">http://spaceninja.com/?p=3993#comment-133120</guid> <description>John, I spent a few hours this evening going over the &lt;a href=&quot;http://dev.twitter.com/doc/&quot; rel=&quot;nofollow&quot;&gt;Twitter API docs&lt;/a&gt; hoping to find a way to exclude @replies, but there&#039;s simply no way to do it through any of the Twitter APIs yet.
I did find &lt;a href=&quot;http://stackoverflow.com/questions/619773/filter-out-replies-in-a-twitter-feed&quot; rel=&quot;nofollow&quot;&gt;a post on stackoverflow&lt;/a&gt; explaining how to accomplish this using javascript and the stock Twitter badge, but that doesn&#039;t really help for our PHP script.
My programmer buddy is going to help me add this to the next version of the script, but since we&#039;ll be filtering out @replies after the fact, there&#039;s a chance that you&#039;ll end up with less tweets than you were expecting (even none!)... unfortunately, as far as I can tell, there&#039;s no magic bullet.</description> <content:encoded><![CDATA[<p>John, I spent a few hours this evening going over the <a
href="http://dev.twitter.com/doc/" rel="nofollow">Twitter API docs</a> hoping to find a way to exclude @replies, but there&#8217;s simply no way to do it through any of the Twitter APIs yet.</p><p>I did find <a
href="http://stackoverflow.com/questions/619773/filter-out-replies-in-a-twitter-feed" rel="nofollow">a post on stackoverflow</a> explaining how to accomplish this using javascript and the stock Twitter badge, but that doesn&#8217;t really help for our PHP script.</p><p>My programmer buddy is going to help me add this to the next version of the script, but since we&#8217;ll be filtering out @replies after the fact, there&#8217;s a chance that you&#8217;ll end up with less tweets than you were expecting (even none!)&#8230; unfortunately, as far as I can tell, there&#8217;s no magic bullet.</p> ]]></content:encoded> </item> </channel> </rss>
