Skip to content

Instantly share code, notes, and snippets.

@gordonmeyer
Last active August 1, 2017 21:45
Show Gist options
  • Save gordonmeyer/5732642 to your computer and use it in GitHub Desktop.
Save gordonmeyer/5732642 to your computer and use it in GitHub Desktop.
A simple Javascript-based reload of a webcam for use with Status Board.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>campage</title>
<meta name="generator" content="BBEdit 10.1">
</head>
<body onload="LoadNewImage()">
<script type="text/javascript" language="JavaScript">
function LoadNewImage()
{
var unique = new Date();
document.images.webcam.src = "http://username:password@camera.example.com:9999/image.jpg?time=" + unique.getTime();
setTimeout(LoadNewImage, 300000);
}
</script>
<img src="http://camera.example.com:8888/image.jpg" name="webcam" height="250" width="250">
</body>
</html>
@gordonmeyer
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment