#!/bin/sh
# (C) 2005 Sato Makoto
# count words of *BSD just grep them:-)
# Wed Jan 26 16:51:51 JST 2005
OB=OpenBSD
NB=NetBSD
FB=FreeBSD
DB=Darwin

DATA=fuga.txt

A="http://ask.slashdot.org/comments.pl?sid=137276&threshold=-1&commentsort=0&tid=190&mode=nested&startat=1&pid=0"
B="http://ask.slashdot.org/comments.pl?sid=137276&threshold=-1&commentsort=0&tid=190&mode=nested&startat=75&pid=0"
C="http://ask.slashdot.org/comments.pl?sid=137276&threshold=-1&commentsort=0&tid=190&mode=nested&startat=150&pid=0"
D="http://ask.slashdot.org/comments.pl?sid=137276&threshold=-1&commentsort=0&tid=190&mode=nested&startat=225&pid=0"
E="http://ask.slashdot.org/comments.pl?sid=137276&threshold=-1&commentsort=0&tid=190&mode=nested&startat=300&pid=0"
F="http://ask.slashdot.org/comments.pl?sid=137276&threshold=-1&commentsort=0&tid=190&mode=nested&startat=375&pid=0"

rm $DATA >& /dev/null
rm $TEMP >& /dev/null

for URL in $A $B $C $D
  do w3m -T text/html -dump $URL >> $DATA && sleep 3
done

for BSD in  $FB $NB $OB $DB
  do echo -n $BSD: && grep -i $BSD $DATA |wc -l
done

echo  -n MacOSX:
grep -i M[Aa][Cc] $DATA|grep OS|wc -l 

