wordcount script

Might be useful if you decide to use a LJ as your writing area. This script saves the current month of writing in the journal, grabbing only the subject and entry text, and then counts the words. Any tags (html or lj tags) are included in the saved file but not in the wordcount.

#!/bin/csh

set user="gconnor_writing"
set pass="yourpasswordhere"
set dir="/home/gconnor/livejournal"
set options="-q"

#set year=`date +%Y`
#set month=`date +%m`

set year="2002"
set month="11"

##foreach year ( 2002 )
##foreach month ( 11 )

set file="$dir/$user-$year-$month.csv"

set url="http://www.livejournal.com/export_do.bml?user=${user}&password=${pass}&year=${year}&month=${month}&format=csv&header=0&field_itemid=0&field_eventtime=0&field_logtime=0&field_subject=1&field_event=1&field_security=0&field_allowmask=0"

wget $options --output-document=$file "$url"

awk -- ' { gsub ("","") ; print ; }'  < $file  | wc -w

##end
##end

Leave a Reply