$(document).ready(function(){Hydrometeor.path="/hm1backend";Hydrometeor.registerEventCallback("process","newInsert");Hydrometeor.joinChannel("hose");Hydrometeor.connect()});function parseText(a){var a=a.replace(/(?:(?:http:\/\/)|(www\.))(.*?)(\s|$|,|\. |\.$|\"|\))/g,'<a href="http://$1$2" target="_blank">http://$1$2</a>$3');var a=a.replace(/(\s|^)\@([0-9a-zA-Z_]+)/g,'$1<a href="http://twitter.com/$2" class="twitter-link" target="_blank">@$2</a>');return a}function newInsert(c){var b=/id{([0-9]+?)}username{(.+?)}avatar{(.+?)}text{(.+?)}type{(.+?)}lang{(.*?)}channel{(.*?)}/;var a=c.match(b);if(a){var d=parseText(a[4]);$("#timeline_body").prepend(constructUpdate(a[1],a[2],a[3],d,a[5]));$(".post:gt(25)",$("#timeline_body")).remove()}}function constructUpdate(e,a,b,d,c){var d='<div class="post '+c+'" id="'+e+'"><table cellspacing="0" cellpadding="0"><tr><td class="status-body"><p><a class="the-username" href="http://twitter.com/'+a+'" target="_blank">'+a+'</a>: <span class="the-message">'+d+"</span></p></td></tr></table></div>";return d}function uid(){var a=new Date;return a.getTime()};