-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
33 lines (31 loc) · 1015 Bytes
/
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
<!doctype html>
<html>
<head>
<title>RH</title>
<script type="text/javascript" src="RH.js"></script>
</head>
<body>
<h1>RH Demo</h1>
<hr>
<span><label id="desc"></label><ul id="rhcontent"></ul></span>
<script type="text/javascript">
function updatecontent() {
function doit() {
document.getElementById("desc").innerHTML = "<b>Reddit Top News as of " + new Date().toUTCString() + ":</b>";
RH.get("http://api.reddit.com/hot",
function(res){
var result = "";
res.forEach(function (e) {
result = result + "<li>" + e + "</li>";
});
document.getElementById("rhcontent").innerHTML = result;
}
)
}
doit();
return doit;
}
setInterval(updatecontent(),6000); // update content every minute
</script>
</body>
</html>