Cool Bash Script to download APNotes

AndrewTheArt
Newbie
Joined: April 27th, 2008, 4:32 pm

April 27th, 2008, 5:07 pm #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
Quote
Like
Share

maz640
Newbie
maz640
Newbie
Joined: April 6th, 2011, 12:01 am

April 26th, 2011, 10:52 pm #2

Used it, loved it. Thanks!
Quote
Like
Share