Last active
December 30, 2015 00:27
-
-
Save gabrielsimoes/718319ec11e0e019eae5 to your computer and use it in GitHub Desktop.
Download homiliae from vatican and save as html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
link=$1 | |
if [[ ! -n $1 ]] | |
then | |
echo "ERROR:no link" >&2 | |
exit 1 | |
fi | |
#htmlheader="<?xml version=\"1.0\" encoding=\"utf-8\"?> | |
#<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" | |
# \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\"> | |
# | |
#<html xmlns=\"http://www.w3.org/1999/xhtml\"> | |
#<head> | |
#<title></title> | |
#</head> | |
#<body> | |
#" | |
htmlheader="<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
" | |
htmlfooter="</body> | |
</html> | |
" | |
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" | | |
sed "s/â/\'/g" | | |
sed "s/â¦/.../g" > tp2.html | |
echo "$htmlheader" | tac >> tp2.html | |
cat tp2.html | tac > page.html | |
echo "$htmlfooter" | tac >> page.tml | |
rm tp2.html .tp1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment