<?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>Ten Minutes With Tim &#187; Wordpress</title>
	<atom:link href="http://www.tenminuteswithtim.com/category/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://www.tenminuteswithtim.com</link>
	<description>technology tips for small business</description>
	<lastBuildDate>Thu, 25 Aug 2011 18:15:36 +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>Integrate Twitter Avatars with WordPress</title>
		<link>http://www.tenminuteswithtim.com/integrate-twitter-avatars-with-wordpress</link>
		<comments>http://www.tenminuteswithtim.com/integrate-twitter-avatars-with-wordpress#comments</comments>
		<pubDate>Thu, 13 Aug 2009 20:04:54 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[avatar]]></category>
		<category><![CDATA[twittar]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.tenminuteswithtim.com/?p=34</guid>
		<description><![CDATA[I recently found this cool wordpress twitter avatar plugin from smashing magazine that displays the twitter avatar for those who don&#8217;t have a gravatar or prefer the twitter image. Unfortunately the plugin doesn&#8217;t work with the new Twitter API and it looks like the talented developer has taken a vacation. Luckily I saw that a [...]]]></description>
			<content:encoded><![CDATA[<p>I recently found this cool <a href="http://www.smashingmagazine.com/2009/01/08/twitter-avatars-in-comments-wordpress-plugin/" target="_blank">wordpress twitter avatar plugin</a> from smashing magazine that displays the twitter avatar for those who don&#8217;t have a gravatar or prefer the twitter image.</p>
<p>Unfortunately the plugin doesn&#8217;t work with the new Twitter API and it looks like the <a href="http://www.ricardojrsousa.com/" target="_blank">talented developer</a> has taken a vacation.</p>
<p>Luckily I saw that a user had posted a fix to the thread on smashing mag and I made their suggested change to get things to work.  However there is a pretty serious flaw to the suggested change, that is &#8211; the plugin will then simply look at the first part of the email (before the @ sign) and use the twitter account image it finds there, regardless of if the email entered is a twitter email or not.  So needless to say I had a lot of interesting photos appearing alongside comments in my blogs&#8230;</p>
<p>So for a quick fix, I changed the code to check for @twitter.com and changed the label of the field to indicate a way to use the twitter avatar.  You can see it in action on my<a href="http://www.hereforthebeer.com"> beer blog</a>.    I am using WordPress 2.8.3 there and with this quick change the twittar plugin works well.</p>
<p>If you want to try this out <a href="http://www.smashingmagazine.com/2009/01/08/twitter-avatars-in-comments-wordpress-plugin/" target="_blank">the original plugin &#8220;Twittar&#8221; can be downloaded here</a>.  I am sure that there are many better ways to accomplish this, and I am looking forward to the <a href="http://ricardojrsousa.com/twittar.html" target="_blank">promised Twittar2 </a>coming soon.  But for a quick fix &#8211; around line 150 find:</p>
<p><code>function showUser($id){<br />
// Will arrange the url we need to open @ twitter to get the photo info<br />
$request = 'http://twitter.com/users/show/show.xml?email='.urlencode($id).'';<br />
// Will open another function that will do all the hard work <img src='http://www.tenminuteswithtim.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
return process($request);<br />
}<br />
</code></p>
<p>and replace it with:</p>
<p><code> function showUser($id){</code></p>
<p>$pos = stristr($id, &#8216;twitter&#8217;);</p>
<p>if ($pos === false) { return process(&#8216;static.twitter.com&#8217;);<br />
} else {<br />
$id = explode(&#8216;@&#8217;, $id);<br />
$id = $id[0];<br />
// Will arrange the url we need to open @ twitter to get the photo info<br />
$request = &#8216;http://twitter.com/users/&#8217;.strval($id).&#8217;.xml&#8217;;<br />
// Will open another function that will do all the hard work <img src='http://www.tenminuteswithtim.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
return process($request);<br />
}<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tenminuteswithtim.com/integrate-twitter-avatars-with-wordpress/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

