#!/bin/sh
rm -rf */
for d in `curl http://textfiles.com/directory.html | grep '<B><A HREF=' | sed 's/<B><A HREF="//g' | sed 's/">.*<\/A><\/B><BR>//g'`; do mkdir $d; for f in `curl -sSf "http://textfiles.com/$d/" | grep '<TR VALIGN=TOP><TD ALIGN=TOP><A HREF="' | sed 's/<TR VALIGN=TOP><TD ALIGN=TOP><A HREF="//g' | sed 's/">.*$//g'`; do curl -sSf "http://textfiles.com/$d/$f" > $d/$f; echo $d/$f; done; done
