Giter Site home page Giter Site logo

slack-history-export's Introduction

a fork of https://gist.github.com/Chandler/fb7a070f52883849de35

My fork is solely to document how to use the code with python3. If you are unfamiliar with python3 but own a mac laptop.

The script finds all channels, private channels and direct messages that your user participates in. it downloads the complete history for those converations and writes each conversation out to seperate json files.

This user centric history gathering is nice because the official slack data exporter only exports public channels.

PS, this only works if your slack team has a paid account which allows for unlimited history.

PPS, this use of the API is blessed by Slack. https://get.slack.help/hc/en-us/articles/204897248

If you want to export the contents of your own private groups and direct messages please see our API documentation.

A simple usage example

cd slack-history-export/
brew install python3
pip3 install pipenv
pipenv --python=/usr/local/bin/python3 shell
pipenv install
pipenv run python slack_history.py --token='123token'

other usage examples

pipenv run python slack_history.py --token='123token'
pipenv run python slack_history.py --token='123token' --dryRun=True
pipenv run python slack_history.py --token='123token' --skipDirectMessages
pipenv run python slack_history.py --token='123token' --skipDirectMessages --skipPrivateChannels

see ./slack_history.py

slack-history-export's People

Contributors

andxyz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

slack-history-export's Issues

Slack Throttling - Need Help

Hi there,
When I go to run this, I run into throttling issues from Slack. It starts getting the channel history and then part way through the list of channels it errors out with "requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://slack.com/api/channels.history?channel=C24KKPRT6&latest=1485907199&oldest=1483228800&count=300&inclusive=0&unreads=0&token=....
Looks like I'm exceeding what slack will let me pull down at once. Is there anyway to work around this? Like to avoiding archived channels, avoid messages from bots, run the request in small batches with built in pauses, something else?
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.