From 34e148158e9f8f2eb240af6a67e3bf81ec84623c Mon Sep 17 00:00:00 2001 From: webcam <webcam@ucc.gu.uwa.edu.au> Date: Sat, 2 May 2020 13:24:50 +0800 Subject: [PATCH] [TPG] Initial commit for backup --- .htaccess | 2 + archive.html | 167 +++++++++++++++++++++ archive.js | 337 +++++++++++++++++++++++++++++++++++++++++++ archive.php | 44 ++++++ camera.php | 52 +++++++ index.html | 108 ++++++++++++++ robots.txt | 5 + webcam-overrides.css | 80 ++++++++++ webcams.js | 78 ++++++++++ 9 files changed, 873 insertions(+) create mode 100644 .htaccess create mode 100755 archive.html create mode 100755 archive.js create mode 100755 archive.php create mode 100755 camera.php create mode 100755 index.html create mode 100755 robots.txt create mode 100755 webcam-overrides.css create mode 100755 webcams.js diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..36e0d11 --- /dev/null +++ b/.htaccess @@ -0,0 +1,2 @@ +#Options +Indexes +ExecCGI +Multiviews +addhandler cgi-script .py diff --git a/archive.html b/archive.html new file mode 100755 index 0000000..1522668 --- /dev/null +++ b/archive.html @@ -0,0 +1,167 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<!-- This is the new Javascript based webcams page by [PXY], + who was sick of the page reloads. Extra crack added by + [TRS], who wanted back and forward to work. --> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <title>UCC Webcams @ Loading...</title> + <link rel="stylesheet" href="https://planet.ucc.asn.au/planet.css" type="text/css" media="screen" /> + <link rel="stylesheet" href="webcam-overrides.css" type="text/css" media="screen" /> + <script type="text/javascript" src="archive.js"></script> + </head> + <body onload="windowOnload()"> +<div class="header"> +<img alt="Planet UCC" id="pucc_logo" + src="//www.ucc.asn.au/images/ucc_logo.gif" /> +<div id="globalnav-wrapper"> + <ul id="portal-globalnav"> + + <li id="portaltab-index_html" class="plain"> + <a href="https://www.ucc.asn.au">Home</a> + </li> + <li id="portaltab-aboutucc" class="plain"> + <a href="https://www.ucc.asn.au/aboutucc/">About Us</a> + </li> + + <li id="portaltab-infobase" class="plain"> + + <a href="https://www.ucc.asn.au/infobase/">Information</a> + </li> + <li id="portaltab-services" class="plain"> + <a href="https://www.ucc.asn.au/services/">Services</a> + </li> + <li id="portaltab-events" class="plain"> + <a href="https://www.ucc.asn.au/infobase/events/">Events</a> + + </li> + <li id="portaltab-planetucc" class="plain"> + <a href="https://planet.ucc.asn.au/">Planet UCC</a> + </li> + <li id="portaltab-planetucc" class="plain"> + <a href="https://wiki.ucc.asn.au/">Wiki</a> + </li> + </ul> +</div> +</div> +<div class="items"> + <h1 id="header">UCC Webcams @ Loading...</h1> + <div class="navMenu"> + <a href="index.html">Live</a> + <a href="https://webcam.ucc.asn.au/clubroom-schematic.png">Map</a> + </div> + <div class=camSection> + <div class="camera" id="webcam4"><img alt="BW Webcam" /></div> + <div class="camera" id="webcam3"><img alt="Webcam 3" /></div> + <div class="camera" id="webcam2"><img alt="Webcam 1" /></div> + <div class="camera" id="uvc1"><img alt="UVC 1" /></div> + <div class="camera" id="webcam1"><img alt="Webcam 2" /></div> + <div class="camera" id="ipcamera1"><img alt="IPCamera1" /></div> + <div class="camera" id="ipcamera2"><img alt="IPCamera2" /></div> + <div class="camera" id="ipcamera3"><img alt="IPCamera3" /></div> + <div class="camera" id="ipcamera4"><img alt="IPCamera4" /></div> + <div class="camera" id="ipcamera5"><img alt="IPCamera5" /></div> + <div class="camera" id="ipcamera7"><img alt="IPCamera7" /></div> + <div class="camera" id="ipcamera6"><img alt="IPCamera6" /></div> + <div class="camera" id="ipcamera9"><img alt="IPCamera9" /></div> + <div class="camera" id="ipcamera10"><img alt="IPCamera10" /></div> + <div class="camera" id="ipcamera8"><img alt="IPCamera8" /></div> + </div> + <div class="nav"> + <table width="100%"> + <tr> + <td> + + « Back<br /> +<a href="javascript:setMinutes(-30)">30</a> +<a href="javascript:setMinutes(-10)">10</a> +<a href="javascript:setMinutes(-5)">5</a> +<a href="javascript:setMinutes(-2)">2</a> +<a href="javascript:setMinutes(-1)">1</a> +minutes +<br /> +<a href="javascript:setDays(-10)">10</a> +<a href="javascript:setDays(-7)">7</a> +<a href="javascript:setDays(-5)">5</a> +<a href="javascript:setDays(-2)">2</a> +<a href="javascript:setDays(-1)">1</a> +days +<a href="javascript:setHours(-6)">6</a> +<a href="javascript:setHours(-2)">2</a> +<a href="javascript:setHours(-1)">1</a> +hours + + </td> +<td align="middle"> + Time Index: <a id="timeindex" href="">Loading...</a><br /> + <a href="javascript:setDateNow()">Now</a> + (<a href="index.html">Live</a>) + </td> + + <td align="right"> + Forward »<br /> + +<a href="javascript:setMinutes(1)">1</a> +<a href="javascript:setMinutes(2)">2</a> +<a href="javascript:setMinutes(5)">5</a> +<a href="javascript:setMinutes(10)">10</a> +<a href="javascript:setMinutes(30)">30</a> +minutes +<br /> +<a href="javascript:setHours(1)">1</a> +<a href="javascript:setHours(2)">2</a> +<a href="javascript:setHours(6)">6</a> +hours +<a href="javascript:setDays(1)">1</a> +<a href="javascript:setDays(2)">2</a> +<a href="javascript:setDays(5)">5</a> +<a href="javascript:setDays(7)">7</a> +<a href="javascript:setDays(10)">10</a> +days + + </td> + </tr> + </table> + <form> + <p align="middle" style="padding:0; margin:0;"> + <span id="nav-dayname">...</span> + <select onChange="navDate()" id="nav-day"></select> + <select onChange="navDate()" id="nav-month"></select> + <select onChange="navDate()" id="nav-year"></select>, + <select onChange="navDate()" id="nav-hour"></select>: + <select onChange="navDate()" id="nav-minute"></select> + </p> + + </form></div> +</div> +<div class="footer"> + <p>Copyright 1993-2014, The University Computer Club Inc. + <<a href="mailto:webmasters@ucc">webmasters@ucc</a>><br /> + Written to be <a href="http://www.w3.org/">specifications compliant</a>. + </p> + <p class="logos" style="text-align: center;"> + <a href="https://www.ucc.asn.au"> + <img style="padding-bottom:1ex;" src="https://www.ucc.asn.au/images/ucc-sun-logo-black.png" alt="UCC" title="University Computer Club" /> + </a> + <img alt="Hacking Life" title="Hacking Life" style="padding-bottom:1ex;" src="https://www.ucc.asn.au/images/glider.png" /> + <a href="https://www.gu.uwa.edu.au"> + <img alt="Guide of Undergraduates" title="UWA Guild of Undergraduates" style="padding-bottom:1ex;" src="https://www.ucc.asn.au/images/guild/spot2001-blue.png" /> + </a> + <a href="https://www.uwa.edu.au"> + <img alt="University of Western Australia" title="University of Western Australia" src="https://www.ucc.asn.au/images/uwa_crest.png" /> + </a> + </p> +</div> + +<script> + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-11604699-2', 'auto'); + ga('send', 'pageview'); + +</script> + </body> +</html> diff --git a/archive.js b/archive.js new file mode 100755 index 0000000..9546c86 --- /dev/null +++ b/archive.js @@ -0,0 +1,337 @@ +var d; +var months = new Array ("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); +var days = new Array ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"); + +function windowOnload() +{ + // set the initial date from the server + // get an XML HTTP Request object + var req = false; + try + { + req = new XMLHttpRequest (); + } + catch (e) + { + try + { + req = new ActiveXObject ("Microsoft.XMLHTTP"); + } + catch (e) + { + } + } + + if (req) + { + req.onreadystatechange = function () + { + if (req.readyState == 4) + { + d = new Date (Date.parse (req.getResponseHeader ("Date"))); + + if (location.hash.length > 0) + { + d.setTime (location.hash.substring(1, location.hash.length)); + } + else + { + d.setMinutes(d.getMinutes() - 1); + } + setupPage(); + setDate(); + } + + }; + + var timestamp = new Date (); + req.open ("HEAD", "index.html?" + timestamp.getTime (), true); + req.send (""); + } +} + +function setDateNow() +{ + // get a new date from the server + // get an XML HTTP Request object + var req = false; + try + { + req = new XMLHttpRequest (); + } + catch (e) + { + try + { + req = new ActiveXObject ("Microsoft.XMLHTTP"); + } + catch (e) + { + } + } + + if (req) + { + req.onreadystatechange = function () + { + if (req.readyState == 4) + { + d = new Date (Date.parse (req.getResponseHeader ("Date"))); + + d.setMinutes(d.getMinutes() - 1); + setDate(); + alignSelects(); + } + + }; + + var timestamp = new Date (); + req.open ("HEAD", "index.html?" + timestamp.getTime (), true); + req.send (""); + } +} + +function setupPage() +{ + var form; + var i; + + document.getElementById("nav-dayname").firstChild.data = days[d.getDay()]; + form = document.getElementById("nav-day"); + for (i = 0; i < 31; i++) + { + form[i] = new Option(i+1,i+1,(d.getDate() == i+1)); + } + form = document.getElementById("nav-month"); + for (i = 0; i < 12; i++) + { + form[i] = new Option(months[i],i,(d.getMonth() == i)); + } + form = document.getElementById("nav-year"); + for (i = 2003; i < d.getFullYear() + 1; i++) + { + form[i-2003] = new Option(i,i,(d.getFullYear() == i)); + } + form = document.getElementById("nav-hour"); + for (i = 0; i < 24; i++) + { + form[i] = new Option(zPad(i.toString()),i,(d.getHours() == i)); + } + form = document.getElementById("nav-minute"); + for (i = 0; i < 60; i++) + { + form[i] = new Option(zPad(i.toString()),i,(d.getMinutes() == i)); + } +} + +function alignSelects() +{ + var form; + var i; + + form = document.getElementById("nav-day"); + for (i = 0; i < 31; i++) + { + if (d.getDate() == i+1) + { + form[i].selected = true; + } + else + { + form[i].selected = false; + } + } + form = document.getElementById("nav-month"); + for (i = 0; i < 12; i++) + { + if (d.getMonth() == i) + { + form[i].selected = true; + } + else + { + form[i].selected = false; + } + } + form = document.getElementById("nav-year"); + for (i = 2003; i < d.getFullYear() + 1; i++) + { + if (d.getFullYear() == i) + { + form[i-2003].selected = true; + } + else + { + form[i-2003].selected = false; + } + } + form = document.getElementById("nav-hour"); + for (i = 0; i < 24; i++) + { + if (d.getHours() == i) + { + form[i].selected = true; + } + else + { + form[i].selected = false; + } + } + form = document.getElementById("nav-minute"); + for (i = 0; i < 60; i++) + { + if (d.getMinutes() == i) + { + form[i].selected = true; + } + else + { + form[i].selected = false; + } + } +} + +function navDate() +{ + d.setDate(document.getElementById("nav-day").value); + d.setMonth(document.getElementById("nav-month").value); + d.setFullYear(document.getElementById("nav-year").value); + d.setHours(document.getElementById("nav-hour").value); + d.setMinutes(document.getElementById("nav-minute").value); + + setDate(); +} + +function zPad(str) +{ + if (str.length == 1) + { + str = "0" + str; + } + return str; +} + +function setAlt (img, text) +{ + var lines = img.alt.split ("\n"); + if (lines.length > 0) + { + img.alt = lines[0] + "\n" + text; + } + else + { + img.alt += "\n" + text; + } +} + +function updateWebcam (webcamid, webcamurl) +{ + var div = document.getElementById (webcamid); + var img = div.getElementsByTagName('img')[0]; + + // get an XML HTTP Request object + var req = false; + try + { + req = new XMLHttpRequest (); + } + catch (e) + { + try + { + req = new ActiveXObject ("Microsoft.XMLHTTP"); + } + catch (e) + { + } + } + + if (req) + { + req.onreadystatechange = function () + { + if (req.readyState == 4) + { + if (req.status == 200 || req.status == 304) + { + //img.parentNode.style.backgroundColor = "transparent"; + div.style.display = 'inline-block'; + //setAlt (img, ""); + } + else + { + div.style.display = 'none'; + //img.parentNode.style.backgroundColor = "darkred"; + //setAlt (img, "(status " + req.status + ")"); + } + } + + }; + + req.open ("HEAD", webcamurl, true); + req.send (""); + } + + // set the image + img.setAttribute ("src",webcamurl); +} + + +function setDate() +{ + window.location.hash = d.getTime(); + //document.getElementById("timeremaining").firstChild.data = "loading..."; + + var timeString = days[d.getDay()]+" "+d.getDate()+" "+months[d.getMonth()]+" "+d.getFullYear()+", "+zPad(d.getHours().toString())+":"+zPad(d.getMinutes().toString()); + document.title = "UCC Webcams @ "+timeString; + document.getElementById("header").firstChild.data = "UCC Webcams @ "+timeString; + document.getElementById("timeindex").firstChild.data = d.getTime(); + document.getElementById("timeindex").href = "#"+d.getTime(); + + document.getElementById("nav-dayname").firstChild.data = days[d.getDay()]; + + var image = d.getFullYear()+zPad((d.getMonth()+1).toString())+"/"+zPad(d.getDate().toString())+"/"+zPad(d.getHours().toString())+"/"+zPad(d.getMinutes().toString())+".jpg"; + updateWebcam ("webcam1", "/archive/colour/" + image); + //updateWebcam ("webcam1-datetime", "/archive/colour/" + image); + updateWebcam ("webcam2", "/archive/colour1/" + image); + updateWebcam ("webcam3", "/archive/colour3/" + image); + updateWebcam ("webcam4", "/archive/bw/" + image); + updateWebcam ("uvc1", "/archive/uvc1/" + image); + updateWebcam ("ipcamera1", "/archive/ipcamera1/" + image); + updateWebcam ("ipcamera2", "/archive/ipcamera2/" + image); + updateWebcam ("ipcamera3", "/archive/ipcamera3/" + image); + updateWebcam ("ipcamera4", "/archive/ipcamera4/" + image); + updateWebcam ("ipcamera5", "/archive/ipcamera5/" + image); + updateWebcam ("ipcamera6", "/archive/ipcamera6/" + image); + updateWebcam ("ipcamera9", "/archive/ipcamera9/" + image); + updateWebcam ("ipcamera10", "/archive/ipcamera10/" + image); + updateWebcam ("ipcamera7", "/archive/ipcamera7/" + image); + updateWebcam ("ipcamera8", "/archive/ipcamera8/" + image); + //setTimeout("clearText()",1000); +} + +function setMinutes(mins) +{ + d.setMinutes(d.getMinutes() + mins); + setDate(); + alignSelects(); +} + +function setHours(hours) +{ + d.setHours(d.getHours() + hours); + setDate(); + alignSelects(); +} + +function setDays(days) +{ + d.setDate(d.getDate() + days); + setDate(); + alignSelects(); +} + +function clearText() +{ + document.getElementById("timeremaining").firstChild.data = ""; +} diff --git a/archive.php b/archive.php new file mode 100755 index 0000000..f184189 --- /dev/null +++ b/archive.php @@ -0,0 +1,44 @@ +<?php + // Need to update this script to make it work. Working on the live feed + // first + + + // list of approved cameras + // (to avoid filesytem traversal, etc + + $approved = array( + "bw", + "colour", + "colour1", + "colour3", + "ipcamera1", + "ipcamera10", + "ipcamera2", + "ipcamera3", + "ipcamera4", + "ipcamera5", + "ipcamera6", + "ipcamera7", + "ipcamera8", + "ipcamera9", + "unigames", + "uvc1", + ); + + $camera = ($_GET['camera']?$_GET['camera']:'nocamera'); + + // check camera is approved - mtearle + if (!in_array($camera,$approved)) + $camera = 'nocamera'; + + $imagelocation="archive/"; + $file = $imagelocation.strtolower($camera).".jpg"; + header("Expires: ".gmdate("D, d M Y H:i:s", time())." GMT"); + if (!is_readable($file)) { + $file="nocamera.jpg"; + } + header("Content-Type: image/jpeg"); + header("Content-Length: ".filesize($file)); + header("Last-Modified: ".gmdate("D, d M Y H:i:s", filectime($file))." GMT"); + passthru("cat $file"); +?> diff --git a/camera.php b/camera.php new file mode 100755 index 0000000..72f6b90 --- /dev/null +++ b/camera.php @@ -0,0 +1,52 @@ +<?php + + // list of approved cameras + // (to avoid filesytem traversal, etc + + $approved = array( + "bw", + "colour", + "colour1", + "colour3", + "ipcamera1", + "ipcamera10", + "ipcamera2", + "ipcamera3", + "ipcamera4", + "ipcamera5", + "ipcamera6", + "ipcamera7", + "ipcamera8", + "ipcamera9", + "unigames", + "uvc1", + ); + $camera = 'nocamera'; + if (isset($_GET['camera']) ) + $camera=$_GET['camera']; + + // check camera is approved - mtearle + if (!in_array($camera,$approved)) + $camera = 'nocamera'; + + $imagelocation="../"; + $file = $imagelocation.strtolower($camera).".jpg"; + $statusfile = $imagelocation.strtolower($camera).".status"; + //echo date('i'); + //echo substr(date('i'), 1, 1); + //echo $file; + + header("Expires: ".gmdate("D, d M Y H:i:s", time())." GMT"); + if (!is_readable($file)) { + $file="nocamera.jpg"; + } + if (file_exists($statusfile)) + usleep(250000); + header("Content-Type: image/jpeg"); + header("Content-Length: ".filesize($file)); + $fps = stat($file); + header("Last-Modified: ".gmdate("D, d M Y H:i:s", $fps[9])." GMT"); + $fp = fopen($file, 'rb'); + fpassthru($fp); + fclose($fp); +?> diff --git a/index.html b/index.html new file mode 100755 index 0000000..b30887f --- /dev/null +++ b/index.html @@ -0,0 +1,108 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<!-- This is the new Javascript based webcams page by [PXY], + who was sick of the page reloads --> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <title>UCC Webcams</title> + <noscript> + <meta http-equiv="refresh" content="10;" /> + </noscript> + <link rel="stylesheet" href="https://secure.ucc.asn.au/~planet/planet.css" type="text/css" media="screen" /> + <link rel="stylesheet" href="webcam-overrides.css" type="text/css" media="screen" /> + <script type="text/javascript" src="webcams.js"></script> +</head> + <body onload="windowOnload()"> +<div class="header"> +<img alt="Planet UCC" id="pucc_logo" + src="https://www.ucc.asn.au/images/ucc_logo.gif" /> +<div id="globalnav-wrapper"> + <ul id="portal-globalnav"> + + <li id="portaltab-index_html" class="plain"> + <a href="https://www.ucc.asn.au">Home</a> + </li> + <li id="portaltab-aboutucc" class="plain"> + <a href="https://www.ucc.asn.au/aboutucc/">About Us</a> + </li> + + <li id="portaltab-infobase" class="plain"> + + <a href="https://www.ucc.asn.au/infobase/">Information</a> + </li> + <li id="portaltab-services" class="plain"> + <a href="https://www.ucc.asn.au/services/">Services</a> + </li> + <li id="portaltab-events" class="plain"> + <a href="http://wiki.ucc.asn.au/Events/">Events</a> + + </li> + <li id="portaltab-planetucc" class="plain"> + <a href="//planet.ucc.asn.au/">Planet UCC</a> + </li> + <li id="portaltab-planetucc" class="plain"> + <a href="http://wiki.ucc.asn.au/">Wiki</a> + </li> + </ul> +</div> +</div> +<div class="items"> + <h1>UCC Webcams</h1> + <div class="navMenu"> + <a href="archive.html">Archive</a> + <a href="https://webcam.ucc.asn.au/clubroom-schematic.png">Map</a> + </div> +</div> +<div class=camSection> + <div class="camera"><a href="camera.php?camera=ipcamera1"><img id="ipcamera1" alt="IPCamera1" src="camera.php?camera=ipcamera1"/></a></div> + <div class="camera"><a href="camera.php?camera=ipcamera2"><img id="ipcamera2" alt="IPCamera2" src="camera.php?camera=ipcamera2"/></a></div> + <div class="camera"><a href="camera.php?camera=ipcamera3"><img id="ipcamera3" alt="IPCamera3" src="camera.php?camera=ipcamera3"/></a></div> + <div class="camera"><a href="camera.php?camera=ipcamera4"><img id="ipcamera4" alt="IPCamera4" src="camera.php?camera=ipcamera4"/></a></div> + <div class="camera"><a href="camera.php?camera=ipcamera5"><img id="ipcamera5" alt="IPCamera5" src="camera.php?camera=ipcamera5"/></a></div> + <div class="camera"><a href="camera.php?camera=ipcamera7"><img id="ipcamera7" alt="IPCamera7" src="camera.php?camera=ipcamera7"/></a></div> + <div class="camera"><a href="camera.php?camera=ipcamera6"><img id="ipcamera6" alt="IPCamera6" src="camera.php?camera=ipcamera6"/></a></div> + <div class="camera"><a href="camera.php?camera=ipcamera9"><img id="ipcamera9" alt="IPCamera9" src="camera.php?camera=ipcamera9"/></a></div> + <div class="camera"><a href="camera.php?camera=ipcamera10"><img id="ipcamera10" alt="IPCamera10" src="camera.php?camera=ipcamera10"/></a></div> + <div class="camera"><a href="camera.php?camera=ipcamera8"><img id="ipcamera8" alt="IPCamera8" src="camera.php?camera=ipcamera8"/></a></div> +</div> +<div class="footer"> + <p><small>Copyright 1993-<span id="copyright">2014</span>, The University Computer Club Inc. + <<a href="mailto:webmasters@ucc">webmasters@ucc</a>><br /> + Written to be <a href="https://www.w3.org/">specifications compliant</a>. + </small></p> + <!--<p class="logos" style="text-align: center;"> + <a href="http://www.ucc.asn.au"> + <img style="padding-bottom:1ex;" src="//www.ucc.asn.au/images/ucc-sun-logo-black.png" alt="UCC" title="University Computer Club" /> + </a> + <a href="http://www.gu.uwa.edu.au"> + <img alt="Guild of Undergraduates" title="UWA Guild of Undergraduates" style="padding-bottom:1ex;" src="//www.ucc.asn.au/images/guild/spot2001-blue.png" /> + </a> + <a href="http://www.uwa.edu.au"> + <img alt="University of Western Australia" title="University of Western Australia" src="//www.ucc.asn.au/images/uwa_crest.png" /> + </a> + </p>--> +</div> +<script type="text/javascript"> + /*var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); + document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));*/ +</script> +<script type="text/javascript"> + /*try { + var pageTracker = _gat._getTracker("UA-11604699-1"); + pageTracker._setDomainName("none"); + pageTracker._setAllowLinker(true); + pageTracker._trackPageview(); + } catch(err) {}*/ +</script> +<script> + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-11604699-2', 'auto'); + ga('send', 'pageview'); + +</script> +</body> +</html> diff --git a/robots.txt b/robots.txt new file mode 100755 index 0000000..51f89e7 --- /dev/null +++ b/robots.txt @@ -0,0 +1,5 @@ +User-agent: sitecheck.internetseer.com +Disallow: / + +User-agent: * +Disallow: / diff --git a/webcam-overrides.css b/webcam-overrides.css new file mode 100755 index 0000000..d7d64a8 --- /dev/null +++ b/webcam-overrides.css @@ -0,0 +1,80 @@ +.camsection{ + font-size: 0; +} +.camera { + width: 465px; + height: 349px; + margin: 0px; + overflow: hidden; + /*padding: 20px;*/ + margin-left: auto; + margin-right: auto; + display: inline-block; + font-size: 0; +} + +.camera img { + display: block; + max-width: 100% +} + +.header { + background: none; +} + +.camSection { + margin-left:auto; + margin-right:auto; + text-align: center; +} + +body { + padding-bottom: 4.5em; +} + +.offline { + /*opacity: 0.1;*/ +} + +/* Haven't touched anything below this */ + +/*the navigation stuff for the archives page*/ +div.nav { + position: fixed; + z-index: 3; + bottom: 0; + left: 0; + right: 0; + width: 100%; + background-color:#ffce7b; + border-top:1px solid #ffa500; + padding: 0.2ex; + padding-bottom: 0.7ex; +} + +div.nav table { + font-size: 75%; + width: 100%; + padding: 0; + border-spacing: 0; +} +div.nav form { + margin-bottom: 0; +} + +.navMenu { + margin-left:20px; +} + +.navMenu a { + padding-right:5px; +} +.navMenu a:visited { color:#00E; } + +/* +gets around planet making room on the right for the sidebar +Really need a generic res.ucc css file that we add to instead of subtract from +*/ +.items { + padding-right: 0; +} diff --git a/webcams.js b/webcams.js new file mode 100755 index 0000000..c84f34b --- /dev/null +++ b/webcams.js @@ -0,0 +1,78 @@ +function windowOnload() +{ + updateTime(); + setInterval("updateTime()", 15000); +} + +function updateWebcam (webcamid, webcamurl) +{ + var date = new Date (); + var fullwebcamurl = webcamurl + "&t" + date.getTime (); + var img = document.getElementById(webcamid); + + // get an XML HTTP Request object + var req = false; + try + { + req = new XMLHttpRequest (); + } + catch (e) + { + try + { + req = new ActiveXObject ("Microsoft.XMLHTTP"); + } + catch (e) + { + } + } + + if (req) + { + req.onreadystatechange = function () + { + if (req.readyState == 4) + { + if (req.status == 200 || req.status == 304) + { + var imgdate = new Date (Date.parse (req.getResponseHeader ("Last-Modified"))); + var servdate = new Date (Date.parse (req.getResponseHeader ("Date"))); + if (Math.abs (imgdate.getTime () - servdate.getTime ()) > 1000 * 60 * 3) + { + console.log("Out Of Sync"); + console.log("imgdate: " + imgdate); + console.log("servdate: " + servdate); + // this image is out of date + img.classList.add('offline'); + } + else + { + //console.log("In Sync"); + img.classList.remove('offline'); + } + } + } + + }; + + req.open ("HEAD", fullwebcamurl, true); + req.send (""); + } + // set the image + //img.src = "http://www.ucc.asn.au/~webcam/" + fullwebcamurl; + img.src = fullwebcamurl; +} + +function updateTime() +{ + var date = new Date (); + updateWebcam ("ipcamera1", "camera.php?camera=ipcamera1"); + updateWebcam ("ipcamera2", "camera.php?camera=ipcamera2"); + updateWebcam ("ipcamera3", "camera.php?camera=ipcamera3"); + updateWebcam ("ipcamera4", "camera.php?camera=ipcamera4"); + updateWebcam ("ipcamera5", "camera.php?camera=ipcamera5"); + updateWebcam ("ipcamera6", "camera.php?camera=ipcamera6"); + updateWebcam ("ipcamera9", "camera.php?camera=ipcamera9"); + updateWebcam ("ipcamera10", "camera.php?camera=ipcamera10"); + updateWebcam ("ipcamera7", "camera.php?camera=ipcamera7"); + updateWebcam ("ipcamera8", "camera.php?camera=ipcamera8");} -- GitLab