Permalink
Browse files

Add 'dbshots' tool.

This is messy and will need to be cleaned up later.
  • Loading branch information...
1 parent c01cd6e commit 0fecd0dd2c0c1a15b9fb3538313dd2faf1597301 @SaberUK committed Jul 15, 2012
Showing with 19 additions and 0 deletions.
  1. +19 −0 bin/dbshots
View
@@ -0,0 +1,19 @@
+#!/usr/bin/env ruby
+# ==============================================================================
+# SaberUK's Dot Files <https://github.com/saberuk/dotfiles/>
+# ==============================================================================
+# Copyright (C) 2012 Peter "SaberUK" Powell <petpow@saberuk.com>
+# ==============================================================================
+require 'date'
+require 'fileutils'
+links = []
+target_base = File.expand_path('~/Dropbox/Public')
+target_route = Date.today.strftime('%Y/%B')
+Dir.glob("#{ENV['HOME']}/Desktop/Screen*.png").each do |screenshot|
+ FileUtils.move(screenshot, "#{target_base}/#{target_route}")
+ links << "https://dl.dropbox.com/u/14234621/#{target_route}/#{File.basename(screenshot).gsub(' ', '%20')}"
+end
+IO.popen('pbcopy', 'r+') do |clipboard|
+ clipboard.print(links.join(' '))
+end unless links.size < 1
+puts "#{links.size} link(s) have been copied to the clipboard."

0 comments on commit 0fecd0d

Please sign in to comment.