Hi Bit,
Love it! Thank you! I did not even know html2text existed.
"apropose htlm" did not catch it as it was not installed
(is now).
A few bumps in the road:
$ html2text -nobs -style pretty -width 132 \
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/
HTTP/1.1 505 HTTP Version Not Supported Connection: close
Date: Mon, 06 Feb 2012 06:26:41 GMT Server: Cherokee/1.0.1
(UNIX) Content-Length: 314 Content-Type: text/html Cache-
Control: no-cache Pragma: no-cache
505 HTTP Version Not Supported
----------------------------------------------------------
Cherokee web server 1.0.1 (UNIX), Port 80
So back to wget and pipe it to html2text:
wget --quiet \
http://releases.mozilla.org/pub/mozilla.org/firefox /releases/ \
-O - | html2text -nobs -style pretty -width 132 | grep -i DIR
[DIR] Parent_Directory -
[DIR] latest 31-Jan-2012 21:58 link
[DIR] latest-3.6 01-Feb-2012 05:38 link
[DIR] latest-10.0 31-Jan-2012 21:58 link
[DIR] 2.0.0.20 18-Dec-2008 09:26 -
[DIR] 3.0.19-real-real 16-Mar-2010 02:52 -
[DIR] 3.6.24 03-Nov-2011 17:55 -
[DIR] 3.6.25 13-Dec-2011 14:04 -
[DIR] 3.6.26 29-Jan-2012 10:54 -
[DIR] 8.0.1 21-Nov-2011 06:50 -
[DIR] 9.0.1 21-Dec-2011 15:57 -
[DIR] 10.0 31-Jan-2012 17:57 -
And repeating (gets me a different mirror):
10.0/ 2012-Jan-31 16:57:40 - Directory
2.0.0.20/ 2008-Dec-18 08:26:59 - Directory
3.0.19-real-real/ 2010-Mar-16 01:52:50 - Directory
3.6.24/ 2011-Nov-03 16:55:01 - Directory
3.6.25/ 2011-Dec-13 13:04:11 - Directory
3.6.26/ 2012-Jan-29 09:54:13 - Directory
8.0.1/ 2011-Nov-21 05:50:19 - Directory
9.0.1/ 2011-Dec-21 14:57:25 - Directory
latest/ 2012-Jan-31 16:57:40 - Directory
latest-10.0/ 2012-Jan-31 16:57:40 - Directory
latest-3.6/ 2012-Jan-29 09:54:13 - Directory
Oh Crap! A third run freezes (yet another mirror).
And the directory I want is either $1 or $2 depending
on the mirror. This would explain some of the problems
I have been having. So I am going to really have to
think about how to carve out the directory name.
AAAHHHHH!
Okay, promise not to laugh:
$ wget --quiet \
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/ \
-O - | \
html2text -nobs -style pretty -width 132 | \
grep -i DIR | \
sed -e "s/\[DIR\]//" | \
awk '{print $1}' | \
sed -e "s/\///"
Did I hear you just laugh?!?!
Thank you for the help!
-T