forked from zyphlar/ip-camera-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·108 lines (92 loc) · 4.24 KB
/
index.php
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script type="text/javascript" src="jquery-2.2.0.min.js"></script>
<script type="text/javascript">
function refresh() {
cam1result = "snapshot.php?camera=1&"+Math.round(Math.random()*1000000);
cam2result = "snapshot.php?camera=2&"+Math.round(Math.random()*1000000);
cam3result = "snapshot.php?camera=3&"+Math.round(Math.random()*1000000);
cam4result = "snapshot.php?camera=4&"+Math.round(Math.random()*1000000);
if (strlen(cam1result) > 102400) { document.getElementById("livestream1").src = cam1result; }
if (strlen(cam2result) > 102400) { document.getElementById("livestream2").src = cam2result; }
if (strlen(cam3result) > 102400) { document.getElementById("livestream3").src = cam3result; }
if (strlen(cam4result) > 102400) { document.getElementById("livestream4").src = cam4result; }
// document.getElementById("livestream1").src = "snapshot.php?camera=1&"+Math.round(Math.random()*1000000);
// document.getElementById("livestream2").src = "snapshot.php?camera=2&"+Math.round(Math.random()*1000000);
// document.getElementById("livestream3").src = "snapshot.php?camera=3&"+Math.round(Math.random()*1000000);
// document.getElementById("livestream4").src = "snapshot.php?camera=4&"+Math.round(Math.random()*1000000);
}
function pageLoad() {
setInterval( "refresh()", 10000 );
}
$.getJSON("https://members.heatsynclabs.org/macs.json", function(data){
$("#computerlist").html("<ul></ul>");
$.each(data, function(i, o){
if (o.note.startsWith("@")) {
$("#computerlist ul").append("<li><a href='https://twitter.com/"+o.note.substr(1)+"'>"+o.name+" ("+o.note+")</a></li>");
} else if (o.note.length > 0) {
$("#computerlist ul").append("<li>"+o.name+" ("+o.note+")</li>");
} else {
$("#computerlist ul").append("<li>"+o.name+"</li>");
}
});
});
</script>
<style type="text/css">
body { background-color: #2C2C29; color: #2C2C29; font-family: Tahoma; font-size: 11px; margin: 0; padding: 0; }
#wrapper { width: 811px; margin: 0 auto; }
#top span { display: none; }
#content { background-color: #fff; padding: 1em; font-size: 1.2em; }
.caption {
background-color: #F3F3F3;
border: 1px solid #DDD;
padding: 4px;
margin: 0 0 0 30px;
width: 320px;
display: inline-block;
}
.footer {
clear: both;
}
h1,h2,h3,h4 {
font-family: Helvetica, Georgia;
font-size: 24px;
letter-spacing: -1px;
margin: 0px 0px 10px;
border-bottom: 1px solid #DCDCDB;
}
h2 { font-size: 22px; }
h3 { font-size: 20px; }
h4 { font-size: 18px; }
</style>
</head>
<bod
<div id="wrapper">
<a href="http://www.heatsynclabs.org"><img src="hsl-logo.png" height="116" /></a>
<div id="content">
<h2>HeatSync Labs Live Webcams</h2>
<p>See if there are people in the lab!<br/>The camera views refresh at least every 10 seconds, though you may not be able to tell if nothing's moving.<br/>
If the cameras are broken, please tweet <a href="https://twitter.com/meznak">@meznak</a> or email nate at heatsynclabs dot org.</p>
<p>Nobody here? Check the <a href="https://twitter.com/heatsynclabs">@HeatSyncLabs</a> feed. See when the next event is scheduled at the <a href="http://www.heatsynclabs.org">HeatSync Website</a>.</p>
<div class="caption">
<img id="livestream1" src="snapshot.php?camera=1" width="320" height="240" />
</div>
<div class="caption">
<img id="livestream2" src="snapshot.php?camera=2" width="320" height="240" />
</div>
<div class="caption">
<img id="livestream3" src="snapshot.php?camera=3" width="320" height="240" />
</div>
<div class="caption">
<img id="livestream4" src="snapshot.php?camera=4" width="320" height="240" />
<!--<img src="images/no_camera.jpg" width="320" height="240" />-->
</div>
<h2>Who's Here?</h2>
<p id="computerlist"></p>
<i>To add your computer, go to <a href="https://members.heatsynclabs.org/macs">https://members.heatsynclabs.org/macs</a></i>
</div>
</div>
</body>
</html>