Skip to content

Instantly share code, notes, and snippets.

@croaky
Created May 24, 2012 14:20
Show Gist options
  • Save croaky/2781847 to your computer and use it in GitHub Desktop.
Save croaky/2781847 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Downloads the Twelve-Factor App guide from http://www.12factor.net/ and
# converts it to plain text for easy reading
# Credit to Dan Choi
twelve-factor() {
base=www.12factor.net
out=twelve-factor.txt
rm $out
wget -r http://$base
grep 'href.*h2' $base/index.html |
sed "s/.*href='\([^']*\)'>.*/\1/" |
while read chapter; do
echo
echo
elinks -dump $base/$chapter
done >> $out
rm -rf $base
echo "File created: $out"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment