<?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: Improving the JSON/P Twitter Widget</title>
	<atom:link href="http://www.barneyb.com/barneyblog/2010/01/15/improving-the-jsonp-twitter-widget/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.barneyb.com/barneyblog/2010/01/15/improving-the-jsonp-twitter-widget/</link>
	<description>Thoughts, rants, and even some code from the mind of Barney Boisvert.</description>
	<lastBuildDate>Thu, 11 Sep 2014 09:58:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Taylor</title>
		<link>https://www.barneyb.com/barneyblog/2010/01/15/improving-the-jsonp-twitter-widget/comment-page-1/#comment-333358</link>
		<dc:creator>Taylor</dc:creator>
		<pubDate>Wed, 28 Nov 2012 23:19:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1173#comment-333358</guid>
		<description>Is there any way that I can edit what you have posted?

I would like to see the 3 not-mentions tweets at all time. Not just the not-mention tweets of my last three (which is how this works now?)

Thank you</description>
		<content:encoded><![CDATA[<p>Is there any way that I can edit what you have posted?</p>
<p>I would like to see the 3 not-mentions tweets at all time. Not just the not-mention tweets of my last three (which is how this works now?)</p>
<p>Thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: barneyb</title>
		<link>https://www.barneyb.com/barneyblog/2010/01/15/improving-the-jsonp-twitter-widget/comment-page-1/#comment-310759</link>
		<dc:creator>barneyb</dc:creator>
		<pubDate>Sat, 26 May 2012 23:42:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1173#comment-310759</guid>
		<description>Of course.  Use any or all of it, and no need to link back (though if you want to do that, I won&#039;t complain).</description>
		<content:encoded><![CDATA[<p>Of course.  Use any or all of it, and no need to link back (though if you want to do that, I won't complain).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: site</title>
		<link>https://www.barneyb.com/barneyblog/2010/01/15/improving-the-jsonp-twitter-widget/comment-page-1/#comment-310678</link>
		<dc:creator>site</dc:creator>
		<pubDate>Sat, 26 May 2012 14:35:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1173#comment-310678</guid>
		<description>Is it alright to place part of this on my web site if I submit a reference point to this website?</description>
		<content:encoded><![CDATA[<p>Is it alright to place part of this on my web site if I submit a reference point to this website?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>https://www.barneyb.com/barneyblog/2010/01/15/improving-the-jsonp-twitter-widget/comment-page-1/#comment-295255</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Sun, 05 Feb 2012 20:33:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1173#comment-295255</guid>
		<description>Hey, just used your page to exclude @replies from my tweets. MAJORLY helpful man, thanks!

One more thing I wanted to add though - in my case I just wanted to pull the one latest tweet. In the case where the latest tweet was a reply, this would mean nothing was returned. So what I did was  make a slight modification - I added an else case and a break at the end of the loop. This means that it will search for the latest non-reply tweet and then break out of the loop like so:

&lt;pre&gt;for (var i=0; i&lt;twitters.length; i++){
  	if (twitters[i].in_reply_to_screen_name != null) {
  	  continue;
  	} else {
    var username = twitters[i].user.screen_name;
    var status = twitters[i].text.replace(/((https?&#124;s?ftp&#124;ssh)\:\/\/[^&quot;\s\]*[^.,;&#039;&quot;&gt;\:\s\\)\]\!])/g, function(url) {
      return &#039;&lt;a href=&quot;&#039;+url+&#039;&quot; rel=&quot;nofollow&quot;&gt;&#039;+url+&#039;&lt;/a&gt;&#039;;
    }).replace(/\B@([_a-z0-9]+)/ig, function(reply) {
      return  reply.charAt(0)+&#039;&lt;a href=&quot;http://twitter.com/&#039;+reply.substring(1)+&#039;&quot; rel=&quot;nofollow&quot;&gt;&#039;+reply.substring(1)+&#039;&lt;/a&gt;&#039;;
    });
    statusHTML.push(&#039;&#039;+status+&#039; &lt;a href=&quot;http://twitter.com/&#039;+username+&#039;/statuses/&#039;+twitters[i].id_str+&#039;&quot; rel=&quot;nofollow&quot;&gt;&#039;+relative_time(twitters[i].created_at)+&#039;&lt;/a&gt;&#039;);
    break;
    }
  }
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Hey, just used your page to exclude @replies from my tweets. MAJORLY helpful man, thanks!</p>
<p>One more thing I wanted to add though &#8211; in my case I just wanted to pull the one latest tweet. In the case where the latest tweet was a reply, this would mean nothing was returned. So what I did was  make a slight modification &#8211; I added an else case and a break at the end of the loop. This means that it will search for the latest non-reply tweet and then break out of the loop like so:</p>
<pre>for (var i=0; i&lt;twitters.length; i++){
  	if (twitters[i].in_reply_to_screen_name != null) {
  	  continue;
  	} else {
    var username = twitters[i].user.screen_name;
    var status = twitters[i].text.replace(/((https?|s?ftp|ssh)\:\/\/[^&quot;\s\]*[^.,;'"&gt;\:\s\\)\]\!])/g, function(url) {
      return '<a href="'+url+'" rel="nofollow">'+url+'</a>';
    }).replace(/\B@([_a-z0-9]+)/ig, function(reply) {
      return  reply.charAt(0)+'<a href="http://twitter.com/'+reply.substring(1)+'" rel="nofollow">'+reply.substring(1)+'</a>';
    });
    statusHTML.push(''+status+' <a href="http://twitter.com/'+username+'/statuses/'+twitters[i].id_str+'" rel="nofollow">'+relative_time(twitters[i].created_at)+'</a>');
    break;
    }
  }
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: barneyb</title>
		<link>https://www.barneyb.com/barneyblog/2010/01/15/improving-the-jsonp-twitter-widget/comment-page-1/#comment-286572</link>
		<dc:creator>barneyb</dc:creator>
		<pubDate>Tue, 06 Dec 2011 18:22:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1173#comment-286572</guid>
		<description>Tom, the result of the &#039;tz_twitter_js&#039; function is equivalent to the first code snippet in my post.  You should change it to look like the second (i.e., don&#039;t return the twitter SCRIPT tags directly, return an inline SCRIPT tag which will use JS to write the twitter SCRIPT tags).  My example uses jQuery.  If you already have jQuery on your page, you&#039;re set.  If not, you&#039;ll need to adapt it to either use a JS framework available to your pages, or do the listening manually.  I haven&#039;t tested, but a simple setTimeout might work also if you don&#039;t have jQuery.</description>
		<content:encoded><![CDATA[<p>Tom, the result of the 'tz_twitter_js' function is equivalent to the first code snippet in my post.  You should change it to look like the second (i.e., don't return the twitter SCRIPT tags directly, return an inline SCRIPT tag which will use JS to write the twitter SCRIPT tags).  My example uses jQuery.  If you already have jQuery on your page, you're set.  If not, you'll need to adapt it to either use a JS framework available to your pages, or do the listening manually.  I haven't tested, but a simple setTimeout might work also if you don't have jQuery.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Hodgson</title>
		<link>https://www.barneyb.com/barneyblog/2010/01/15/improving-the-jsonp-twitter-widget/comment-page-1/#comment-286563</link>
		<dc:creator>Tom Hodgson</dc:creator>
		<pubDate>Tue, 06 Dec 2011 17:11:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1173#comment-286563</guid>
		<description>@barneyb

I&#039;m really sorry but I&#039;m not suite sure what I need to do, I have the following code which calls the feed from my tweet widget which is:

function tz_twitter_js($tz_twitter_username, $tz_twitter_postcount) {
        return &#039;[script type=&quot;text/javascript&quot; src=&quot;http://twitter.com/javascripts/blogger.js&quot;][/script]
		[script type=&quot;text/javascript&quot; src=&quot;http://twitter.com/statuses/user_timeline/&#039;.$tz_twitter_username.&#039;.json?callback=twitterCallback2&amp;count=&#039;.$tz_twitter_postcount.&#039;&quot;][/script]&#039;;
}

--------------------------

and then I have the following in my php to call the widget:

[!-- BEGIN .widget-section --]
                [div class=&quot;widget-section&quot;]
                
                	[?php /* Widgetised Area */ if ( !function_exists( &#039;dynamic_sidebar&#039; ) &#124;&#124; !dynamic_sidebar( &#039;Footer Two&#039; ) ) ?]
                    
                [!-- END .widget-section --]   
                [/div]

--------------------------------

Obviously i have replaced the arrowed parenthesis with square [] so it shows in the comments here.

Thanks for any help in advance.</description>
		<content:encoded><![CDATA[<p>@barneyb</p>
<p>I'm really sorry but I'm not suite sure what I need to do, I have the following code which calls the feed from my tweet widget which is:</p>
<p>function tz_twitter_js($tz_twitter_username, $tz_twitter_postcount) {<br />
        return '[script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"][/script]<br />
		[script type="text/javascript" src="http://twitter.com/statuses/user_timeline/'.$tz_twitter_username.'.json?callback=twitterCallback2&amp;count='.$tz_twitter_postcount.'"][/script]';<br />
}</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>and then I have the following in my php to call the widget:</p>
<p>[!-- BEGIN .widget-section --]<br />
                [div class="widget-section"]</p>
<p>                	[?php /* Widgetised Area */ if ( !function_exists( 'dynamic_sidebar' ) || !dynamic_sidebar( 'Footer Two' ) ) ?]</p>
<p>                [!-- END .widget-section --]<br />
                [/div]</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Obviously i have replaced the arrowed parenthesis with square [] so it shows in the comments here.</p>
<p>Thanks for any help in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: barneyb</title>
		<link>https://www.barneyb.com/barneyblog/2010/01/15/improving-the-jsonp-twitter-widget/comment-page-1/#comment-286559</link>
		<dc:creator>barneyb</dc:creator>
		<pubDate>Tue, 06 Dec 2011 16:35:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1173#comment-286559</guid>
		<description>Tom, I assume you&#039;re returning an HTML string containing the container and script tags?  If so, you just need to invoke that function on DOMReady, rather than in the page flow.</description>
		<content:encoded><![CDATA[<p>Tom, I assume you're returning an HTML string containing the container and script tags?  If so, you just need to invoke that function on DOMReady, rather than in the page flow.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Hodgson</title>
		<link>https://www.barneyb.com/barneyblog/2010/01/15/improving-the-jsonp-twitter-widget/comment-page-1/#comment-286555</link>
		<dc:creator>Tom Hodgson</dc:creator>
		<pubDate>Tue, 06 Dec 2011 16:11:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1173#comment-286555</guid>
		<description>I have the following code as the twitter feed is a widget within my footer on wordpress, how should I adapt the following code to conform with this method:

&lt;pre&gt;function tz_twitter_js($tz_twitter_username, $tz_twitter_postcount) {
        return &#039;
		&#039;;
}&lt;/pre&gt;

Thanks very much
Tom</description>
		<content:encoded><![CDATA[<p>I have the following code as the twitter feed is a widget within my footer on wordpress, how should I adapt the following code to conform with this method:</p>
<pre>function tz_twitter_js($tz_twitter_username, $tz_twitter_postcount) {
        return '
		';
}</pre>
<p>Thanks very much<br />
Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Owen</title>
		<link>https://www.barneyb.com/barneyblog/2010/01/15/improving-the-jsonp-twitter-widget/comment-page-1/#comment-286334</link>
		<dc:creator>Tom Owen</dc:creator>
		<pubDate>Sun, 04 Dec 2011 21:38:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1173#comment-286334</guid>
		<description>Thank you so much for this.... was really bugging me because I have a JS image loader and it was hanging badly displaying all the images in a big row until the twitter loaded.... 

Now it works great...

YOURE THE MAN

thank you</description>
		<content:encoded><![CDATA[<p>Thank you so much for this&#8230;. was really bugging me because I have a JS image loader and it was hanging badly displaying all the images in a big row until the twitter loaded&#8230;. </p>
<p>Now it works great&#8230;</p>
<p>YOURE THE MAN</p>
<p>thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Murk</title>
		<link>https://www.barneyb.com/barneyblog/2010/01/15/improving-the-jsonp-twitter-widget/comment-page-1/#comment-275546</link>
		<dc:creator>Murk</dc:creator>
		<pubDate>Wed, 14 Sep 2011 05:57:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1173#comment-275546</guid>
		<description>Hello Barney, 
Thanks for finding a solution for this issue and again thanks a lot for this very usefull script! 
I will use your scripts and offcourse I will put your credits in the script.

Could it be made possible to get feeds with particular hashtag by this script?</description>
		<content:encoded><![CDATA[<p>Hello Barney,<br />
Thanks for finding a solution for this issue and again thanks a lot for this very usefull script!<br />
I will use your scripts and offcourse I will put your credits in the script.</p>
<p>Could it be made possible to get feeds with particular hashtag by this script?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
