diff -r dd7d86fbee70 -r e42d9f11f6e2 client/compteur.html --- a/client/compteur.html Mon Feb 20 17:44:20 2012 +0100 +++ b/client/compteur.html Tue Feb 21 11:48:06 2012 +0100 @@ -19,7 +19,7 @@ font-size: 24px; } h2 { - font-size: 48px; font-weight: bold; margin: 20px 0; + font-size: 68px; font-weight: bold; margin: 2px 0; } @@ -41,6 +41,8 @@ * */ var searchKeywords = ['Sarkozy', 'Hollande', 'Bayrou']; + var totalTweets = 0; + $(function() { myTweetSource = new Btv_TweetSource({ @@ -48,16 +50,26 @@ }); myTweetSource.setOnNewTweets(function() { - var _filtered = this.afterDate(startHour); - $("#nbtweets").html(_filtered.count()); + totalTweets = this.afterDate(startHour).count(); }); + + setInterval(function() { + var _aff = parseInt($("#nbtweets").html()); + if (_aff < totalTweets) { + if (_aff) { + $("#nbtweets").html(1+_aff); + } else { + $("#nbtweets").html(totalTweets); + } + } + }, 200); });