Skip to content

Instantly share code, notes, and snippets.

@maxhelskens
maxhelskens / slack_file_remover.py
Created April 3, 2017 13:36
Python script to bulk remove all files older than 60 days. NOTE: insert your own slack token.
import requests
import json
import datetime
import time
# You can get your own token at: https://api.slack.com/custom-integrations/legacy-tokens
TOKEN = ''
# Timestamp of 60 days ago
ts_to = time.time() - 60 * 24 * 60 * 60
# Number of files to return