Upload Screen Shots to DreamObjects

I work in a fascinating world – it’s that place tucked between developers and customers.  Recently I’ve been residing in the land of DreamObjects – our new cloud storage service, built on Ceph.  You may have seen Brett’s announcement last week that it’s no longer in beta.  I’m very excited we’re able to offer a reliable, scalable, and accessible storage system for backups, application storage, and site content.

One of the great things I get to do is think about new ways customers can use the new services we create.  DreamObjects is great for backups and content storage, all very serious stuff, but it can also be a lot of fun.  In fact, one of our core values is to embrace fun.  One of our developers, Ryan Petrello, does this very well by always finding and posting links to images apt to jabber conversations.  I’ll let you use your imagination why a picture of canned lobster is necessary.

canned lobster

What’s really interesting is this tool of irreverence morphed into a utility of productivity.  As a distributed team, we communicate over jabber, do a lot of screen sharing, and until recently, emailed screen shots back and forth.  Ryan wrote a shell script to take a screen shot, upload it to a public Dropbox folder, and copy the link to the clipboard.  The screen shot uploads and you’ve got a link ready to paste in your jabber client.

http://en.wikipedia.org/wiki/File:Gluehlampe_01_KMJ.png

http://en.wikipedia.org/wiki/File:Gluehlampe_01_KMJ.png

As I was working on DreamObjects and looking for interesting ways to test it, the connection became obvious.  With credit to Jonathan LaCour and Ryan Petrello for their python-fu, I now have a way to take screen shots, upload them to DreamObjects, open the link in my browser and have the link in my clipboard.  It works great on OS X – here’s how to install it:

Installation Files

The files needed can be downloaded from GitHub and I’ve tested this on Mac OS X 10.8.2.  It should work on earlier version of OS X as well.  If you’re running linux, this could work with a suitable replacement for screencapture.  Feel free to fork the code!  https://github.com/dreamhost/screencaps

Prerequisites

The code is written in Python and requires the boto library to connect to DreamObjects.  You can install boto by opening the Terminal and typing:

pip install boto

If you get an error typing the message above, -bash: pip: command not found then you do not have pip installed on your system.  You can type this in the Terminal instead (it will require an admin password):

sudo easy_install boto

Installation

  • If you don’t have one already, create a folder called bin in your home directory and copy dhdo-screencap.py file into it.
  • Open dhdo-screencapy.py with TextEdit and paste in your DreamObjects Access Key, Secret Key and bucket name (ensure each of these are surrounded by single quotes).  Save and close it.
  • Double-click Copy Screenshot to Clipboard.workflow and click Install to install the Automator Service.

Assign Keyboard Shortcut

  • Open System Preferences and click Keyboard.
  • Select Keyboard Shortcuts.
  • Select Services from the left-hand side.
  • On the right-side, check the box next to Copy Screenshot to Clipboard.
  • Click on the grayed-out “none” and “add shortcut” will appear.
  • Click “add shortcut” then type in the actual shortcut you want to use.  I recommend Shift-Command-5

keyboard_shortcut

Success!

You should now be able to use the keyboard shortcut you created to activate screencapture.  Drag the crosshairs to create a screen shot.  It’ll be uploaded to DreamObjects and opened in a browser window.  That link will be in your clipboard, ready to paste your own canned lobster picture when needed.