-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
66 lines (64 loc) · 2.62 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Tweets do GCCSD!</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="gcct.css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
var twitt = '';
function atualiza() {
$.getJSON("http://search.twitter.com/search.json?q=%23gccsd&limit=20&show_user=true&callback=?",
function(data) {
$("#twitts").empty();
$.each(data.results, function(i, item) {
var created_at = new Date(item.created_at);
var today = new Date();
/* TODO date difference */
var date_diff = today.getTime() - created_at.getTime();
date_diff = ((date_diff / 1000) / 60);
if (date_diff < 60)
date_string = Math.round(date_diff) + " minutos atrás";
else if ((date_diff / 60) < 24)
date_string = Math.round(date_diff / 60) + " horas atrás";
else
date_string = Math.round((date_diff/60)/24) + " dias atrás";
source = item.source.replace(/>/g,'>').replace(/</g,'<').replace(/"/g,'"');
twitt = '<tr><td><img src="' + item.profile_image_url + '" /></td>';
twitt += '<td><div class="pretwitt"></div></td>'
twitt += '<td class="tdtwitt"><div class="twitt"><div class="inboxtop"><div></div></div><a class="twit_link" href="http://twitter.com/' + item.from_user + '" target="_blank">@' + item.from_user + '</a> (' + date_string + ' Via: ' + source + ')<br /><br />';
twitt += '' + item.text +'<div class="inboxbottom"><div></div></div></div></td>';
twitt += '</tr>';
$("#twitts").append(twitt);
});
});
}
$(document).ready( function() {
atualiza();
$("#recarregar").click( function() {
atualiza();
});
});
</script>
</head>
<body>
<div id="main">
<div class="boxtop"><div></div></div>
<div class="boxcontent">
<div style="float: right;"><input type="button" id="recarregar" value="Recarregar"></div>
<h1>Tweets com a hashtag #gccsd</h1>
<table id="twitts">
</table>
</div>
<div class="boxbottom"><div></div></div>
</div>
<div id="footer">
<div class="boxtop"><div></div></div>
<div class="boxcontent">
<p>Estes são os Twitts feitos usando a Hashtag #gccsd.</p>
<p>Desenvolvido por <a href="http://twitter.com/InFog9">@InFog9</a>.</p>
</div>
<div class="boxbottom"><div></div></div>
</div>
</body>
</html>