before google docs

This commit is contained in:
Sami Samhuri 2011-09-17 17:23:33 -07:00
parent a0b9bab130
commit bd5156caf7
2 changed files with 20 additions and 1 deletions

19
public/out.html Normal file
View file

@ -0,0 +1,19 @@
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<meta name=viewport content="width=device-width, initial-scale=1">
<style>
body { font-family: 'helvetica neue', helvetica, sans-serif }
</style>
<title>watch yourself</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>
$(function() {
$.get('/stats', function(stats, textStatus) {
alert(textStatus + '\n' + stats)
})
})
</script>
</html>

View file

@ -35,7 +35,7 @@ module WatchYourself
stats = { :time => now, :sys => params['sys'], :dia => params['dia'], :pulse => params['pulse'] }
$stderr.puts "[#{now}] IN: #{stats.inspect}"
redis.zadd key('stats'), now, JSON.stringify(stats)
redirect '/stats.html'
redirect '/out.html'
end
get '/stats' do