(function($) {

	$.fn.getTwitter = function(options) {

		var o = $.extend({}, $.fn.getTwitter.defaults, options);
		var msgError = true;
		var nliE = 0;

		var printError = function () {
			$("div#twitter-slider").fadeTo(500, 1, function() {
				$("div#twitter-slider").html('erro!');
				$("div#twitter-slider").fadeTo(5500, 1, function() {
					clearInterval(showError);
				});
			});
		}
	
		var goRoll = function () {
			$("div#twitter-slider").html($("ul#twitter_update_list li:eq("+nliE+")").html());
			nliE = nliE+1;
			if($("ul#twitter_update_list li:eq("+nliE+")").html() == null) {
				nliE = 0;
			}
			$("div#twitter-slider").fadeTo(800, 1, function() {
				$("div#twitter-slider").fadeTo(6000, 1, function() {
					$("div#twitter-slider").fadeTo(800, 0, function() {
						goRoll();
					});
				});
			});
		}

		$(this).hide();

		$(this).append("<div id='twitter-slider'></div>");
		$(this).append("<ul id='twitter_update_list'><li></li></ul>");

		$("ul#twitter_update_list").hide();

		var pl = $("<span class='preloader'>carregando tweets...</span>");

		$("div#twitter-slider").append(pl);

		$(this).show();

		$.getScript("http://twitter.com/javascripts/blogger.js");
		$.getScript("http://twitter.com/statuses/user_timeline/"+o.userName+".json?callback=twitterCallback2&count="+o.numTweets, function() {

			$('ul#twitter_update_list li').each(function() {
				if(o.showTime) {
					$(this).find('a').attr('target', '_blank');
					texto = $(this).find('a:last').html();
					if(texto != null) {
						texto = '('+texto+')';
						texto = texto.replace('about ', '');
						texto = texto.replace('less than', 'menos de');
						texto = texto.replace(' an ', ' 1 ');								
						texto = texto.replace(' a ', ' um ');								
						texto = texto.replace('minute', 'minuto');				
						texto = texto.replace('hour', 'hora');
						texto = texto.replace('day', 'dia');
						texto = texto.replace('week', 'semana');
						texto = texto.replace('months', 'meses');
						texto = texto.replace('month', 'm&ecirc;s');				
						texto = texto.replace('ago', 'atr&aacute;s');
						$(this).find('a:last').html(texto);
					}
				} else {
					$(this).find('a:last').html('');
				}
				texto = $(this).html();
				if(texto.length > o.showLength) {
					texto =  texto.substring(0, o.showLength) + '...';
				}
				$(this).html(texto);
			});

			$("div#twitter-slider").fadeTo(800, 0, function() {
				goRoll();
			});
		});

		//$(pl).remove();

	};

	// plugin defaults
	$.fn.getTwitter.defaults = {
		userName: null,
		showTime: 1,
		showLength: 400,
		numTweets: 5
	};

})(jQuery);

<!--//--><![CDATA[//><!--
	$(document).ready(function() { $("div#twitter").getTwitter({ userName: 'fsbprdigital' }); });
//--><!]]>