[Swansea Hackspace] Raspberry Pi - kiosk mode

Justin Mitchell justin at discordia.org.uk
Fri Jan 23 22:15:48 GMT 2015


On Fri, 2015-01-23 at 21:54 +0000, Emyr Morris wrote:
> yessss.... ajax - I was hoping to avoid ajax
> 
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

<script type="text/javascript">

function keepalive()
{
	$.get("http://localhost/cgi-bin/keepalive.cgi");
}

// when document finishes loading, 
// set a timer to call keepalive every 30 seconds
$(document).ready(function(){
	window.setInterval(keepalive, 30000);
});

</script>
	

the keepalive.cgi can just be a simple as 'touch /tmp/keepalive.log'

then a cron job can test the timestamp and act accordingly





More information about the Hackspace mailing list