Skip to content

Instantly share code, notes, and snippets.

View andrewcmyk's full-sized avatar

Andrew Le andrewcmyk

View GitHub Profile
@andrewcmyk
andrewcmyk / slack_delete.rb
Last active April 22, 2018 01:07 — forked from jamescmartinez/slack_delete.rb
This Ruby script will bulk remove all Slack files older than 30 days. Just add your API token from https://api.slack.com/web#authentication into the token quotes at the top of the file.
require 'net/http'
require 'json'
require 'uri'
require 'active_support/time'
@token = ''
def list_files
ts_to = (Time.now - 6.months).to_i # 6 months ago
params = {