[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: funny thing about "docs.info.apple.com"



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

In article <43A1A819.B24CE832@buckeye-express.com>,
Paul R. Santa-Maria <paulrsm@buckeye-express.com> wrote:
>Jorge Chamorro Bieling wrote:
>> IS THERE A (EASY) WAY TO DOWNLOAD ALL OF THEM ?
>
>Below is a list of 466 articles in
>Apple's Tech Info Library (TIL) that
>apply to the Apple II family.  I know
>there are more, but I doubt there are
>more than 500 relevant articles.
>
>[snip]

Given that list of article numbers, you could feed it to something like
this (create a file named "list" with just the numbers in it):

for i in `cat list`; do lynx -source http://docs.info.apple.com/article.html\?artnum=$i | awk 'BEGIN {print "<html><body>"} $0 ~ "kbtitle" {print last; p=1} $0 ~ "kbgutter" {p=0; print "</tr><tr>"} $0 ~ "Date Created:" {print} END {print "</tr></table></body></html>"} p == 1 {print} {last=$0}' >$i.html; done

This will strip out the headers, search box, and other extraneous junk and
leave behind a relatively simple file that'll still load into anything that
accepts HTML.

I tested it with a loop that just tried retrieving everything from 1 to 100. 

for i in `seq 1 100`; ...

Invalid pages turned out to be 41 bytes long and were easily removed with
the following:

rm `find -size 41c`

  _/_
 / v \ Scott Alfter (remove the obvious to send mail)
(IIGS( http://alfter.us/            Top-posting!
 \_^_/ rm -rf /bin/laden            >What's the most annoying thing on Usenet?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDodRUVgTKos01OwkRAleFAJ0cbBRkdA3/+w8mH1txZphEmzLyawCg+Sbh
W8Y1u29oqDklqYDD/0Ke8XY=
=38Ji
-----END PGP SIGNATURE-----