jQuery.fn.reverse=Array.prototype.reverse;String.prototype.linkify=function() {return this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+/g,function(m) {return m.link(m);});};String.prototype.linkuser=function() {return this.replace(/[@]+[A-Za-z0-9-_]+/g,function(u) {var username=u.replace("@","") return u.link("http://twitter.com/"+username);});};String.prototype.linktag=function() {return this.replace(/[#]+[A-Za-z0-9-_]+/,function(t) {var tag=t.replace("#","%23") return t.link("http://search.twitter.com/search?q="+tag);});};function fetch_tweets(elem) {elem=$(elem);input=elem.attr('title');lang=elem.attr('lang');if(input!=window.tweetbox['text-'+input]) {window.tweetbox['last_id'+input]=0;window.tweetbox['text-'+input]=input;window.tweetbox['count-'+input]=12;;} var url="http://search.twitter.com/search.json?q="+input+"&lang="+lang+"&rpp="+rrp+"&since_id="+window.tweetbox['last_id'+input]+"&callback=?";$.getJSON(url,function(json) {$('div.tweet:gt('+window.tweetbox['limit']+')',elem).each(function(){$(this).fadeOut('slow')});$(json.results).reverse().each(function() {if($('#tw'+this.id,elem).length==0) {window.tweetbox['count-'+input]++;var thedate=new Date(Date.parse(this.created_at));var hour = thedate.getHours();var tag2 = "";if (hour > 12) {hour = hour - 12;tag2 = " PM";}else if (hour == 12){tag2 = " PM";}else {tag2 = " AM";}var min=thedate.getMinutes();var minvalue = ((min < 10) ? "0" : "") + min;var thedatestr=hour+':'+minvalue+tag2;var divstr='
'+this.from_user+' - '+thedatestr+'
'+this.text.linkify().linkuser().linktag()+'