#!/bin/bash

for id in 1368967681 1369229436 1369664609 1370183418 1370619490 1371221474 1371910141 1372600987 1373727878 1374844531 1376314324 1377958763 1379427247 1381242140 1382451378 1384784582
do
    file="${id}.html"
    temp="${file}.tmp"
    wget -O "${temp}" "https://ex14.vip2ch.com/test/read.cgi/news4ssnip/${id}/"
    sed -e '/<script[^<]*$/,/<\/script>/d' \
        -e '/<script type="text\/javascript" src="http:\/\/.*"><\/script>/d' \
        -e '/adsbygoogle/d' \
        -e '/shift_jis/d' \
        -i "${temp}"
    iconv -f SJIS -t UTF8//IGNORE//TRANSLIT "${temp}" -o "${file}"
    rm -f "${temp}"
done

exit 0
