in reply to Subdir globs

btrott has a good point, but you *could* combine elements of a search engine with this script. Basically, you would crawl the site (beginning with the homepage) checking all linked pages within the domain and downloading those with the target extension.

I'd start with one of the search engine/site crawlers that are available, and modify it as I go. Basically, you're looking for any link (so search the returned code of the front page for "<a href=" and work from there to find new search pages. But have it check each link for the extension you're looking for; in this case, when your code pulls out the URL of the link (however you have it do that) check it for the extension:

if(/.txt/i) { ...

- Ozymandias