Skip to content

Instantly share code, notes, and snippets.

@nfo
Created December 1, 2010 11:27
Show Gist options
  • Save nfo/723364 to your computer and use it in GitHub Desktop.
Save nfo/723364 to your computer and use it in GitHub Desktop.
Sends a screenshot via HTTP (faster than logging to LogMeIn for simple checks)
require 'rubygems'
require 'sinatra'
get '/' do
Dir.mktmpdir('screenme') do |dir|
file = File.join(dir, Time.now.strftime('%Y%m%d%H%M%S') + '.png')
%x(/usr/sbin/screencapture -x #{file})
send_file file
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment