Permalink
Browse files

snapshot: Fri Jul 29 02:04:40 -0700 2011

  • Loading branch information...
mallipeddi committed Jul 29, 2011
1 parent 206298d commit bfb29f6adda93a5c12fabda16f4f40a4f660cc82
Showing with 12 additions and 1 deletion.
  1. +12 −1 tumblr-backup.rb
View
13 tumblr-backup.rb 100644 → 100755
@@ -28,7 +28,7 @@
def fetch(uri_str, limit = 10)
raise ArgumentError, 'HTTP redirect too deep' if limit == 0
uri = URI.parse(uri_str)
- # puts "Fetching #{uri}"
+ puts "Fetching #{uri} -- #{limit}"
response = Net::HTTP.get_response(uri)
yield case response
when Net::HTTPSuccess then response
@@ -190,3 +190,14 @@ def fetch_img(uri_str)
end
puts "Done."
+
+status = `git status`
+if (status =~ /nothing to commit/)
+ puts "Nothing to do."
+else
+ if system("git commit -a -m \"snapshot: #{Time.now.to_s}\" && git push -u origin master")
+ puts "Updated."
+ else
+ puts "Failed."
+ end
+end

0 comments on commit bfb29f6

Please sign in to comment.