Cool Bash Script to download APNotes

Trouble with your account, the boards, or techie stuff in general? Post here and we'll do our best to fix it.

Cool Bash Script to download APNotes

AndrewTheArt
Newbie
Joined: 27 Apr 2008, 16:32

27 Apr 2008, 17:07 #1

Hey guys,

If anybody here uses Linux/Unix, then they can take advantage of this cool Bash script I made to download all the APNotes chatpers (1-41) into one massive text file.

You need to have Lynx installed for this to work - in Ubuntu, just type -

Code: Select all

sudo apt-get install lynx


Here are the one-liners you can paste in your terminal to get the notes-

One massive text file with all chapters

Code: Select all

for i in $(seq 1 41); do lynx -dump http://www.apnotes.net/ch${i}.html >> ApNotesAllChapters.txt; done;


Individual text files for each chapter

Code: Select all

for i in $(seq 1 41);do lynx -dump http://www.apnotes.net/ch${i}.html >> Ch${i}APNotes.txt; done;


Here are the"script" versions of the above (basically just prettier formatting)

One massive text file with all chapters

Code: Select all

#/bin/bash
for i in $(seq 1 41);
do
lynx -dump http://www.apnotes.net/ch${i}.html >> ApNotesAllChapters.txt;
done


Individual text files for each chapter

Code: Select all

#/bin/bash
for i in $(seq 1 41);
do
lynx -dump http://www.apnotes.net/ch${i}.html >> Ch${i}.txt;
done


Enjoy, and give me credit if you post this elsewhere, please :D :D :D

- Andrew
Reply

maz640
Newbie
Joined: 06 Apr 2011, 00:01

26 Apr 2011, 22:52 #2

Used it, loved it. Thanks!
Reply