title: How to take screenshot of a website with Rails 3.1? -- without using a service
body: <p>Almost every answer I've found references using some existing service. <strong>Is there a way to do this using Rails 3.1 programmatically?</strong> This was dead easy to do with PHP (there are prebuilt libraries in PHP that do this).</p>
  
  <p>What I'm looking to do, given a URL, is:</p>
  
  <ol>
  <li><p>Take a screenshot of the website</p></li>
  <li><p>Crop it (only take the top left most 100x100 pixels</p></li>
  </ol>
  
  <p>PS. Here is my environment: Rails <strong>3.1</strong>, Ruby <strong>1.9.2</strong></p>
  
  <p><strong>Note:</strong> The solution would probably need to follow any redirections on the URL as well.</p>
  
  <p><strong>Updates:</strong></p>
  
  <ul>
  <li><p>I've seen <a href="https://github.com/topfunky/osxscreenshot">https://github.com/topfunky/osxscreenshot</a> The problem is that it requires an older version of Ruby (1.8.x) and will only work on my dev Mac machine.</p></li>
  <li><p>I've seen the vulnerability with Wordpress (they have a service that doesn't do any rate limiting which someone could potentially abuse). I would not want to abuse their resources for my benefit... <a href="http://s.wordpress.com/mshots/v1/http%3A%2F%2Fstackoverflow.com%2F?w=500">http://s.wordpress.com/mshots/v1/http%3A%2F%2Fstackoverflow.com%2F?w=500</a></p></li>
  <li><p>The cropping will be easy with <a href="http://rmagick.rubyforge.org/">http://rmagick.rubyforge.org/</a> or <a href="https://github.com/thoughtbot/paperclip">https://github.com/thoughtbot/paperclip</a></p></li>
  </ul>