(function(d){d.fn.tweet=function(j){function l(b){var c=Date.parse(b),h=arguments.length>1?arguments[1]:new Date;c=parseInt((h.getTime()-c)/1E3);return c<60?"less than a minute ago":c<120?"about a minute ago":c<2700?parseInt(c/60).toString()+" minutes ago":c<5400?"about an hour ago":c<86400?"about "+parseInt(c/3600).toString()+" hours ago":c<172800?"1 day ago":parseInt(c/86400).toString()+" days ago"}var a={username:["dhgamache"],avatar_size:null,count:1,intro_text:null,outro_text:null,join_text:null,
auto_join_text_default:null,auto_join_text_ed:null,auto_join_text_ing:null,auto_join_text_reply:null,auto_join_text_url:null,loading_text:"loading tweet...",query:null};d.fn.extend({linkUrl:function(){var b=[],c=/((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi;this.each(function(){b.push(this.replace(c,'<a href="$1">$1</a>'))});return d(b)},linkUser:function(){var b=[],c=/[\@]+([A-Za-z0-9-_]+)/gi;this.each(function(){b.push(this.replace(c,'<a href="http://twitter.com/$1">@$1</a>'))});
return d(b)},linkHash:function(){var b=[],c=/ [\#]+([A-Za-z0-9-_]+)/gi;this.each(function(){b.push(this.replace(c,' <a href="http://search.twitter.com/search?q=&tag=$1&lang=all&from='+a.username.join("%2BOR%2B")+'">#$1</a>'))});return d(b)},capAwesome:function(){var b=[];this.each(function(){b.push(this.replace(/(a|A)wesome/gi,"AWESOME"))});return d(b)},capEpic:function(){var b=[];this.each(function(){b.push(this.replace(/(e|E)pic/gi,"EPIC"))});return d(b)},makeHeart:function(){var b=[];this.each(function(){b.push(this.replace(/[&lt;]+[3]/gi,
"<tt class='heart'>&#x2665;</tt>"))});return d(b)}});j&&d.extend(a,j);return this.each(function(){var b=d('<ul class="tweet_list">').appendTo(this),c='<p class="tweet_intro">'+a.intro_text+"</p>",h='<p class="tweet_outro">'+a.outro_text+"</p>",k=d('<p class="loading">'+a.loading_text+"</p>");if(typeof a.username=="string")a.username=[a.username];var g="";if(a.query)g+="q="+a.query;g+="&q=from:"+a.username.join("%20OR%20from:");g="http://search.twitter.com/search.json?&"+g+"&rpp="+a.count+"&callback=?";
a.loading_text&&d(this).append(k);d.getJSON(g,function(m){a.loading_text&&k.remove();a.intro_text&&b.before(c);d.each(m.results,function(f,e){f=a.join_text=="auto"?e.text.match(/^(@([A-Za-z0-9-_]+)) .*/i)?a.auto_join_text_reply:e.text.match(/(^\w+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+) .*/i)?a.auto_join_text_url:e.text.match(/^((\w+ed)|just) .*/im)?a.auto_join_text_ed:e.text.match(/^(\w*ing) .*/i)?a.auto_join_text_ing:a.auto_join_text_default:a.join_text;f='<span class="tweet_join"> '+f+" </span>";
f=a.join_text?f:" ";var i='<a class="tweet_avatar" href="http://twitter.com/'+e.from_user+'"><img src="'+e.profile_image_url+'" height="'+a.avatar_size+'" width="'+a.avatar_size+'" alt="'+e.from_user+'\'s avatar" border="0"/></a>';i=a.avatar_size?i:"";var n='<a href="http://twitter.com/'+e.from_user+"/statuses/"+e.id+'" title="view tweet on twitter">'+l(e.created_at)+"</a>";e='<span class="tweet_text">'+d([e.text]).linkUrl().linkUser().linkHash().makeHeart().capAwesome().capEpic()[0]+"</span>";b.append("<li>"+
i+n+f+e+"</li>");b.children("li:first").addClass("tweet_first");b.children("li:odd").addClass("tweet_even");b.children("li:even").addClass("tweet_odd")});a.outro_text&&b.after(h)})})}})(jQuery);