(function($) {
$.showTweets = function(who) {
	$.ajax({
		dataType: "json",
		url: "http://twitter.com/status/user_timeline/"+who+".json?count=1&callback=?",
		error: function(req,stat,err) {
			$('.footerTwitter').html("<p>Hrmm, that didn't work...</p>");
		},
		success: function(d) {
			if( d.length > 0 ) {
				txt = d[0].text.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+/g,function(m){return m.link(m)})
					.replace(/#[\S]+/g,function(m){return'<a target="_blank" href="http://search.twitter.com/search?q=%23'+m.substr(1)+'">'+m+'</a>'})
					.replace(/@[\S]+/g,function(m){return'<a target="_blank" href="http://twitter.com/'+m.substr(1)+'">'+m+'</a>'});

				$('.footerTwitter').append('<p>'+txt+'</p>');
			} else
				$('.footerTwitter').html("<p>Hrmm, that didn't work</p>");
		}
	});
};
})(jQuery);

jQuery(document).ready( function($) {
	$.showTweets('monsterfarm');
});
