39 /* Mots-clés pour déclencher la recherche |
39 /* Mots-clés pour déclencher la recherche |
40 var searchKeywords = [ '#lgw', '#legrandwebze', 'webze' ]; |
40 var searchKeywords = [ '#lgw', '#legrandwebze', 'webze' ]; |
41 * */ |
41 * */ |
42 var searchKeywords = ['Sarkozy', 'Hollande', 'Bayrou']; |
42 var searchKeywords = ['Sarkozy', 'Hollande', 'Bayrou']; |
43 |
43 |
|
44 var totalTweets = 0; |
|
45 |
44 $(function() { |
46 $(function() { |
45 |
47 |
46 myTweetSource = new Btv_TweetSource({ |
48 myTweetSource = new Btv_TweetSource({ |
47 keywords: searchKeywords |
49 keywords: searchKeywords |
48 }); |
50 }); |
49 |
51 |
50 myTweetSource.setOnNewTweets(function() { |
52 myTweetSource.setOnNewTweets(function() { |
51 var _filtered = this.afterDate(startHour); |
53 totalTweets = this.afterDate(startHour).count(); |
52 $("#nbtweets").html(_filtered.count()); |
|
53 }); |
54 }); |
|
55 |
|
56 setInterval(function() { |
|
57 var _aff = parseInt($("#nbtweets").html()); |
|
58 if (_aff < totalTweets) { |
|
59 if (_aff) { |
|
60 $("#nbtweets").html(1+_aff); |
|
61 } else { |
|
62 $("#nbtweets").html(totalTweets); |
|
63 } |
|
64 } |
|
65 }, 200); |
54 }); |
66 }); |
55 </script> |
67 </script> |
56 </head> |
68 </head> |
57 <body> |
69 <body> |
58 <div id="container"> |
70 <div id="container"> |
59 <h1>Total des tweets #LGW</h1> |
71 <h1>Total des Tweets</h1> |
60 <h2 id="nbtweets"></h2> |
72 <h2 id="nbtweets">0</h2> |
61 </div> |
73 </div> |
62 |
74 |
63 </body> |
75 </body> |
64 </html> |
76 </html> |