vim-jp slacklog/log-data
データ構造がいまいちわからん
Go読めないtakker.icon
生成されたJSONを直接読んで構造を手書きするか
JSON構造
必要そうな項目だけ抜粋
code:schema.ts
type User = {
id: string;
name: string;
profile: {
image_24: string;
image_32: string;
image_48: string;
image_72: string;
image_192: string;
image_512: string;
image_1024: string;
image_original: string; // ないこともある
};
};
code:schema.ts
type Channel = {
id: string;
name: string;
created: number;
is_archived: boolean;
topic: {
value: string;
};
purpose: {
value: string;
};
};
messages
https://github.com/vim-jp/slacklog/tree/log-data/slacklog_data/:channelId/:yyyy-MM-dd.json
code:schema.ts
type Message = {
type: 'message';
user: string;
ts: string;
reactions: {
name: string;
count: number;
users: string[];
}[];
text: string;
attachments?: {
fallback: string;
id: number;
title: string;
title_link string;
text: string;
image_url: string;
service_name: string;
service_icon: string;
from_url: string;
original_url: string;
}[];
thread_ts?: string; // threadのID
subtype?: 'thread_broadcast'; // channelにも投稿した場合
replies?: {
user: string;
ts: string;
}[];
};
OGPとかが展開されるとattachmentsが使われる
mentionとかはどういうデータ形式なんだろう?
threadの取り扱いも気になる
そもそもtsってなんだろう?
time stampかな?
とりあえず一覧だけ取得してみるか
channel join message
code:ts
type JoinMessage = {
type: 'message';
subtype: 'channel_join';
user: string;
text: string;
};
ファイルとか
https://github.com/vim-jp/slacklog/raw/log-data/files/:fileId/:filename
https://github.com/vim-jp/slacklog/raw/log-data/emojis/:emoji.:ext
scrapboxに取り込みたいけど、どういうformatにすればいいかな……?
各channelのログは、1日ごとに区切ってページにする
threadはどうする?
indentを一段下げて表示するか
アイコンは一つずつページにしておく
user profileもページにしておく
user iconは行の先頭に置く
2021-07-31 16:28:31 scriptはgithubに移しておくか
23:39:59 repoだけつくった