tweetcast/nodejs/client/js/script.js
changeset 341 cab5c9e10f90
parent 340 a99a04556e3b
child 342 60b8281442b8
--- a/tweetcast/nodejs/client/js/script.js	Fri Oct 28 16:46:13 2011 +0200
+++ b/tweetcast/nodejs/client/js/script.js	Fri Oct 28 18:48:14 2011 +0200
@@ -82,7 +82,8 @@
 	}
 	html += '<h4>' + a_user + '@' + tweet.user.screen_name + '</a></h4><p class="created_at">' + new Date(tweet.created_at).toLocaleTimeString() + '</p><p class="tweet_text">';
 	lastend = 0;
-	txt = '';
+	txt = tweet.text.replace(/(https?:[0-9a-zA-Z\/\-_\.~&?=]+)/g,'<a href="$1" target="_blank">$1</a>').replace(/@([0-9a-zA-Z_]+)/g,'<a href="http://twitter.com/$1" target="_blank">@$1</a>');
+/*	txt = '';
 	entities = [];
 	for (var i in tweet.entities.hashtags) {
 	    entities.push({
@@ -110,7 +111,7 @@
  		txt += tweet.text.substring(lastend, entities[i].start) + entities[i].html;
         lastend = entities[i].end;
     }
-	txt += tweet.text.substring(lastend);
+	txt += tweet.text.substring(lastend); */
 	html += txt + '</p></li></div>';
 	return html;
 }
@@ -216,7 +217,7 @@
         tweetData.waitUpdate = false;
         getUpdate();
         tweetData.blockUpdate = true;
-        setTimeout(delayedUpdate, 300);
+        setTimeout(delayedUpdate, 100);
     }
 }