|
10
|
1 |
<!DOCTYPE html> |
|
|
2 |
<html lang="en"> |
|
|
3 |
<head> |
|
|
4 |
<meta charset="utf-8" /> |
|
|
5 |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> |
|
|
6 |
<title>Bubble-TV</title> |
|
|
7 |
<meta name="description" content="" /> |
|
|
8 |
<link rel="stylesheet" href="css/base-metric.css" /> |
|
|
9 |
<style type="text/css"> |
|
16
|
10 |
#container { |
|
|
11 |
width: 312px; |
|
|
12 |
height: 312px; |
|
|
13 |
margin: 200px auto; |
|
|
14 |
padding: 35px; |
|
|
15 |
background: #0031ff; |
|
|
16 |
color: #fff; |
|
|
17 |
} |
|
|
18 |
h1 { |
|
|
19 |
font-size: 35px; |
|
|
20 |
} |
|
|
21 |
h2 { |
|
|
22 |
font-size: 35px; |
|
22
|
23 |
margin-top:120px; |
|
16
|
24 |
line-height:35px; |
|
10
|
25 |
} |
|
16
|
26 |
h3 { |
|
|
27 |
font-size: 122px; font-weight: bold; margin-left: 0px; line-height:120px; |
|
|
28 |
} |
|
10
|
29 |
</style> |
|
|
30 |
|
|
|
31 |
<script type="text/javascript" src="lib/jquery.min.js"></script> |
|
|
32 |
<script type="text/javascript" src="lib/protoclass.js"></script> |
|
|
33 |
<script type="text/javascript" src="lib/box2d.js"></script> |
|
|
34 |
<script type="text/javascript" src="js/tweetanim.js"></script> |
|
|
35 |
<script type="text/javascript" src="js/tweetvote-anim.js"></script> |
|
|
36 |
<script type="text/javascript" src="js/podium.js"></script> |
|
|
37 |
<script type="text/javascript" src="js/tweetsource.js"></script> |
|
|
38 |
<script type="text/javascript"> |
|
|
39 |
/* Heure de début de l'émission |
|
|
40 |
var startHour = new Date("Feb 24 2012 23:30:00 UTC+0100"); |
|
|
41 |
* */ |
|
|
42 |
var startHour = new Date() - 120000; |
|
|
43 |
|
|
|
44 |
/* Mots-clés pour déclencher la recherche |
|
|
45 |
var searchKeywords = [ '#lgw', '#legrandwebze', 'webze' ]; |
|
|
46 |
* */ |
|
|
47 |
var searchKeywords = ['Sarkozy', 'Hollande', 'Bayrou']; |
|
|
48 |
|
|
13
|
49 |
var totalTweets = 0; |
|
|
50 |
|
|
10
|
51 |
$(function() { |
|
|
52 |
|
|
|
53 |
myTweetSource = new Btv_TweetSource({ |
|
|
54 |
keywords: searchKeywords |
|
|
55 |
}); |
|
|
56 |
|
|
|
57 |
myTweetSource.setOnNewTweets(function() { |
|
13
|
58 |
totalTweets = this.afterDate(startHour).count(); |
|
10
|
59 |
}); |
|
13
|
60 |
|
|
|
61 |
setInterval(function() { |
|
|
62 |
var _aff = parseInt($("#nbtweets").html()); |
|
|
63 |
if (_aff < totalTweets) { |
|
|
64 |
if (_aff) { |
|
|
65 |
$("#nbtweets").html(1+_aff); |
|
|
66 |
} else { |
|
|
67 |
$("#nbtweets").html(totalTweets); |
|
|
68 |
} |
|
|
69 |
} |
|
|
70 |
}, 200); |
|
10
|
71 |
}); |
|
|
72 |
</script> |
|
|
73 |
</head> |
|
|
74 |
<body> |
|
|
75 |
<div id="container"> |
|
16
|
76 |
<h1>#LGW</h1> |
|
|
77 |
<h2>Total des tweets</h2> |
|
18
|
78 |
<h3 id="nbtweets">0</h3> |
|
10
|
79 |
</div> |
|
|
80 |
|
|
|
81 |
</body> |
|
|
82 |
</html> |