Correction for hashtag keywords draft
authorveltr
Fri, 24 Feb 2012 15:28:00 +0100
changeset 42 6cba3a02a1a1
parent 41 91adc8bf6205
child 43 d63529bd67ad
Correction for hashtag keywords
client/js/tweetsource.js
--- a/client/js/tweetsource.js	Fri Feb 24 12:08:41 2012 +0100
+++ b/client/js/tweetsource.js	Fri Feb 24 15:28:00 2012 +0100
@@ -5,7 +5,7 @@
  * */
 
 function regexpFromText(_text) {
-    return new RegExp('(' + _text.replace(/\W/gim,'\\$1') + ')','gim');
+    return new RegExp('(' + _text.replace(/(\W)/gim,'\\$1') + ')','gim');
 }
 
 Btv_TweetArray = function() {
@@ -216,10 +216,10 @@
     this.tweetArray = _tweetArray;
     this.majorInterval = 10000; // Time slices for calculating the minor Interval setting
     this.minimumInterval = 1000; // Safe limit to avoid tweets going to the wrong column
-    this.initialBuffer = 20000; // don't start with empty columns, but show the tweets of the last 20000 seconds
+    this.initialBuffer = 30000; // don't start with empty columns, but show the tweets of the last 30 seconds
     this.waitIfNoTweets = 2000;
     this.callback = _callback;
-    this.lastEndTime = new Date().valueOf() - 20000;
+    this.lastEndTime = new Date().valueOf() - this.initialBuffer;
     this.isPaused = false;
     this.onMajorInterval();
 }
@@ -253,11 +253,9 @@
     if (_l) {
         this.lastEndTime = this.currentSlice.tweetAtPos(_l - 1).date_value;
         this.minorInterval = Math.floor(Math.max(this.minimumInterval, this.majorInterval / _l));
-        console.log("Added "+_l+" tweets to the queue, with an interval of "+this.minorInterval+" ms");
         this.onMinorInterval();
     } else {
         var _this = this;
-        console.log("No tweets in the queue, waiting");
         window.setTimeout(function() {
             _this.onMajorInterval();
         }, this.waitIfNoTweets);