Skip to content

Instantly share code, notes, and snippets.

@lssimoes
Forked from gabrielsimoes/vadown.sh
Created December 29, 2015 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lssimoes/83598cdafff2a2f16ae0 to your computer and use it in GitHub Desktop.
Save lssimoes/83598cdafff2a2f16ae0 to your computer and use it in GitHub Desktop.
Download homiliae from vatican and save as html
#!/bin/bash
link=$1
if [[ ! -n $1 ]]
then
link=http://w2.vatican.va/content/francesco/pt/apost_letters/documents/papa-francesco_bolla_20150411_misericordiae-vultus.html
fi
curl $link > .tp1
cat .tp1 |
#sed 's/« /""/g' | sed 's/ »/"/g' |
recode html..utf-8 |
sed 's/–/–/g' |
sed -e '/<!-- \/CONTENUTO DOCUMENTO -->/q' |
tac | sed -e '/<!-- CONTENUTO DOCUMENTO -->/q' |
sed "s/“/\"/g" |
sed "s/”/\"/g" > tp2.html
echo -e "\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">" >> tp2.html
cat tp2.html | tac | sed 's/â^À¦/.../g' > page.html
rm tp2.html .tp1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment