Skip to content

Instantly share code, notes, and snippets.

@qwertme
Last active September 3, 2019 14:36
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qwertme/037923c23e1740ec8f22d3dc61b24873 to your computer and use it in GitHub Desktop.
Save qwertme/037923c23e1740ec8f22d3dc61b24873 to your computer and use it in GitHub Desktop.
require 'google_drive'
while true do
begin
session = GoogleDrive::Session.from_config("config.json")
session.files(q: "trashed = false and (name contains 'unadjustednonraw' or name contains 'facetile' or name contains 'thumb' or name contains 'mini' or name contains 'largepv') and mimeType = 'image/jpeg' and modifiedTime > '2017-08-01T12:00:00'") do |file|
puts file.name
file.delete
end
puts 'done'
rescue Exception => e
puts 'restarting in 1...'
puts e.backtrace
sleep 1
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment