Side Project, Tip

How to Remove All Slack Files Older than 30 Days (With Ruby!)

Over the past year or so I’ve been hosting (moderating?) a private slack channel for some of my friends from high school and previous jobs. What started as a small channel of about five people as since grown into a small community of around forty. While this isn’t an enormous number, it’s large enough that we’ve been eating through our storage space rather quickly. My first thought was to go to the Slack management console, erase a bunch of old files, and be about my day. Unfortunately, unless you’re on a paid tier you can’t manage files very well (you’d have to remove each one individually…and seeing as around 98% of our files were tiny memes that would take forever).

Enter Ruby!

After some Googling around I found this awesome gist that did the bulk of the work for me. I just replaced the throwaway token with my own and saved the script. That should have been the end of it, but I kept getting a series of SSL errors on my Windows 10 machine that wouldn’t let me run the code.