#!/bin/sh

# Setting PATH
PATH=$PATH:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
export PATH

# save stdin to a file since unzip doesn't work on streams
TEMP=`mktemp`
dd of=$TEMP 2> /dev/null
TEMPDIR=`mktemp -d`
unzip -oq $TEMP -d $TEMPDIR   # Extract the file
tr "<" "\012" < $TEMPDIR/content.xml | egrep '^text:p|text:span' \
	| cut '-d>' -f2, | uniq | sed '/^$/ d'
rm $TEMP
rm -r $TEMPDIR   #Delete excess (formatting) folders
