Skip to content

Instantly share code, notes, and snippets.

@Fonsan
Created December 20, 2013 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fonsan/8056688 to your computer and use it in GitHub Desktop.
Save Fonsan/8056688 to your computer and use it in GitHub Desktop.
webscope
<html>
<head>
<meta http-equiv="refresh" content="3" >
<title>LOL</title>
</head>
<body>
<img style="width:100%;height:100%" src="data:image/gif;base64,<%= @image %>">
</body>
</html>
require 'sinatra'
require 'Base64'
LOL = {}
Thread.start {
loop do
LOL[:image] = Base64.encode64(`imagesnap -w 2 -`)
end
}
get '/' do
@image = LOL[:image]
erb :index
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment