slat

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2018 License: MIT Imports: 13 Imported by: 0

README

slat

Slack archive tool

This tool maintains a JSON archive of a Slack workspace's public channels. The archive can be seeded with a full export from Slack, so you will get your full message history even on a free plan.

slat is designed to run from cron and update the archive incrementally, so as long as you don't run out of free messages between cron runs, you will retain all of your messages.

Motivation

slat was written in the final days of the Slack IRC Gateway to maintain a training corpus for chatbots. This corpus had previously been maintained by watching IRC.

The code is a little quick & dirty, but intended for production use. If you wish to archive more than the bare minimum message history it keeps now, submissions are welcome.

Installation

You can build and install the slat command with "go get".

$ go get github.com/pteichman/slat/cmd/slat

Usage

To seed an archive directory with an export from Slack, run slat on the archive zip file:

$ slat -o /path/to/archive "My Slack export Jan 1 2018.zip"

To update that archive with new messages, you will need a Slack API token. You can create one that works with slat here: https://api.slack.com/custom-integrations/legacy-tokens

Pass that token in the process environment, like this:

$ SLACK_API_TOKEN="xoxp..." slat -o /path/to/archive

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportArchiveFile

func ExportArchiveFile(outdir, archive string) error

ExportArchiveFile writes the messages from a Slack archive .zip file to a series of .json files in outdir.

func ExportHistory

func ExportHistory(outdir, token string) error

ExportHistory updates the slat archive in outdir to include any new messages since the archive was last updated.

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL