Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Slack Channel Scraper

Scrapes 3 months of message history from Slack channels that start with external- or end with -internal. Outputs JSON.

Run

python slack_scraper.py

Setup

Slack Scraper Setup

  1. Create or select a Slack app with a bot token.
  2. Ensure the bot has these scopes: channels:history, channels:read, users:read.
  3. Install the app to the workspace and invite the bot to the target channels.
  4. Create a .env file and set:
    SLACK_BOT_TOKEN=xoxb-...
    
  5. Install dependencies:
    pip install -r requirements.txt
    

Notes

  • If you get not_in_channel, invite the bot to the channel.
  • If you get missing_scope, update scopes in the Slack app and reinstall it.

"My Week" version (1 week, all channels you're in)

The script lives in ~/Projects/slack_scraper_my_week.py. For a 1-week export of all channels you're in (to search what you did well / what didn’t go well):

cd ~/Projects
python slack_scraper_my_week.py

Setup for My Week

  1. Use a user token so the script sees "channels I'm in":
    • Slack API Apps → your app → OAuth & Permissions
    • Under User Token Scopes add: channels:history, channels:read, users:read, groups:read (for private channels)
    • Reinstall the app to the workspace, then copy the OAuth Access Token (starts with xoxp-)
  2. In .env add:
    SLACK_USER_TOKEN=xoxp-...
    
    (You can keep SLACK_BOT_TOKEN for the original scraper; this script uses SLACK_USER_TOKEN first.) Put a .env in ~/Projects with the token, or the script will load from ~/slack_scraper/.env if you run from there. Install deps: pip install slack-sdk python-dotenv

Output

  • slack_my_week_YYYYMMDD.json – all messages from your channels; each message has "is_me": true/false
  • slack_my_week_my_messages_only_YYYYMMDD.json – only messages you sent (easy to search)

Search in an editor or with grep, e.g. grep -i "did well\|went well" slack_my_week_my_messages_only_*.json

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages