diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-08-06 21:01:38 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-08-06 21:01:38 -0700 |
commit | 3e6da6e25c74f170dd896e5e0bc82b54f21b4d8e (patch) | |
tree | ef11701f9d8f8fb5f76f741b4f21439d2748359a /convert_slack.py | |
parent | cbfaf23ae398626b0abae2d3d6c3ec294c8ff22b (diff) | |
download | mu-3e6da6e25c74f170dd896e5e0bc82b54f21b4d8e.tar.gz |
.
Diffstat (limited to 'convert_slack.py')
-rw-r--r-- | convert_slack.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/convert_slack.py b/convert_slack.py index f30dabae..882cc71b 100644 --- a/convert_slack.py +++ b/convert_slack.py @@ -1,7 +1,9 @@ -# Import JSON from a Slack admin export. +# Import JSON from a Slack admin export into a disk image Qemu can load. +# +# Dependencies: python, netpbm # # Images downloaded as follows: -# grep image_72 . -r |grep -v users.json |column 3 |sort |uniq |sed 's/?.*//' |sed 's,\\,,g' |sed 's/"//' |sed 's/", $//' > images.list +# grep image_72 . -r |grep -v users.json |awk '{print $3}' |sort |uniq |sed 's/?.*//' |sed 's,\\,,g' |sed 's/"//' |sed 's/",$//' > images.list # wget -i images.list --wait=0.1 # # fix some lying images # for f in $(file *.jpg |grep PNG |sed 's/:.*//'); do mv -i $f $(echo $f |sed 's/\.jpg$/.png/'); done @@ -10,7 +12,11 @@ # for f in *.jpg; do jpegtopnm $f |pnmtopnm -plain > ppm/$(echo $f |sed 's/\.jpg$//').ppm; done # for f in *.png; do png2pnm -n $f > ppm/$(echo $f |sed 's/\.png$//').ppm; done # -# Dependencies: python netpbm and my 'column' perl script +# To construct the disk image: +# dd if=/dev/zero of=data.img count=201600 # 100MB +# python convert_slack.py |dd of=data.img conv=notrunc +# Currently this process yields errors for ~70 items on the Future of Software +# group. We fail to load those. # # Notes on input format: # Redundant 'type' field that's always 'message'. Probably an "enterprise" feature. |