slack-message-json-convert-csv

command module
v0.0.0-...-816c65d Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: MIT Imports: 12 Imported by: 0

README

slack-message-json-convert-csv

ツールの概要

Slack のデータのエクスポート機能により出力した各チャンネルのメッセージデータ( JSON 形式)を、 CSV 形式に変換するツールです。

以下の情報を CSV ファイルに出力します。

  • thread_ts ... スレッド ID (スレッド形式ではないメッセージの場合は空白)
  • ts ... タイムスタンプ ( JST )
  • user_name ... ユーザ名( real_name + display_name )
  • text ... 投稿メッセージ

動作確認は以下の環境で行っています。

  • macOS Catalina 10.15.3
  • Amazon WorkSpaces / Standard with Windows 10 バンドル
    • OS エディション: Windows Server 2016 Datacenter
    • OS バージョン: 1607
    • x64-based

開発環境

  • macOS Catalina 10.15.3
  • go 1.12.4

インストール

Go のインストール後、 tz パッケージを追加でインストールします。

go get 4d63.com/tz

ビルド

Makefile が配置されているディレクトリで make コマンドを実行し、 macOS 、 Windows 用の実行ファイルを生成します。

make
rm -rf ./bin/darwin64/slack-message-json-convert-csv
rm -rf ./bin/windows64/slack-message-json-convert-csv.exe
GOOS=darwin GOARCH=amd64 go build -o ./bin/darwin64/slack-message-json-convert-csv ./main.go
GOOS=windows GOARCH=amd64 go build -o ./bin/windows64/slack-message-json-convert-csv.exe ./main.go

使い方

Slack からデータをエクスポート

Slack の標準機能を使ってワークスペースのデータをエクスポートしてください。

エクスポートしたデータの構造は以下のとおりです。( 2019/03/29 現在)

<Workspace Name> Slack export <term>
├ user.josn
├ channels.json
├ integration_logs.json
├ channel-01
│  ├ yyyy-mm-dd.json
│  └ yyyy-mm-dd.json
└ channel-02
   └ yyyy-mm-dd.json

※ フリー / スタンダードプランの場合

各ファイルの詳細については以下を参照してください。

変換ツールの実行

任意のチャンネルのディレクトリ直下( yyyy-mm-dd.json と同一の階層)に実行ファイルを保存・実行すると、カレントディレクトリに SlackMessages.csv を作成します。

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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