#! /bin/bash
# Last edited on 2016-05-09 23:48:54 by stolfilocal

# Cleanups posts from a Bitcointalk "latest posts" page,
# removing the site headers, writing each post
# as a separate HTML file.

outDir="$1"; shift; # Output directory.

mkdir -p "${outDir}"

sed \
    -e 's:< *\(div[^<>]*\)>:\n<\1>\n:g' \
    -e 's:< */ *div *>:\n</div>\n:g' \
| split-posts.gawk \
    -v outDir="${outDir}"

    
