old/delete.rb
# Channel IDs to specifically target
# future: blacklist certain files from being deleted
Channel IDs to specifically target
future: blacklist certain files from being deleted
Channel IDs to specifically target future : blacklist certain files from being deleted
def list_files(channel)
  ts_to = (Time.now - 3 * 30 * 24 * 60 * 60).to_i 
  params = {
      token: @token,
      ts_to: ts_to,
      count: 1000,
      types: 'images,videos',
      channel: channel
  }
  uri = URI.parse('https://slack.com/api/files.list')
  uri.query = URI.encode_www_form(params)
  response = Net::HTTP.get_response(uri)
  JSON.parse(response.body)['files']
end
def list_files ( channel ) ts_to = ( Time . now - 3 * 30 * 24 * 60 * 60 ) . to_i params = { token : @token , ts_to : ts_to , count : 1000 , types : 'images,videos' , channel : channel } uri = URI . parse ( 'https://slack.com/api/files.list' ) uri . query = URI . encode_www_form ( params ) response = Net :: HTTP . get_response ( uri ) JSON . parse ( response . body ) [ 'files' ] end
Channel IDs to specifically target
future: blacklist certain files from being deleted
Channel IDs to specifically target future : blacklist certain files from being deleted
# 90 days ago
channel