#! /bin/bash

cd pics/$1

/usr/bin/perl -pli~ -e 's/\<\/HTML\>/\<p\>\&nbsp\;\<\/p\>\n\<address\>\nPhotos by Celeste Hutchins\<BR \/\>\n\<\!\-\- Creative Commons License \-\-\>\n\<a rel\=\"license\" href\=\"http\:\/\/creativecommons\.org\/licenses\/by\/2\.0\/\"\>\<img alt\=\"Creative Commons License\" border\=\"0\" src\=\"http\:\/\/creativecommons\.org\/images\/public\/somerights20\.gif\" \/\>\<\/a\>\<br \/\>\nThis work is licensed under a \<a rel\=\"license\" href\=\"http\:\/\/creativecommons\.org\/licenses\/by\/2\.0\/\"\>Creative Commons License\<\/a\>\.\n\<\!\-\- \/Creative Commons License \-\-\>\n\n\n\<\!\-\-\n\n\<rdf\:RDF xmlns\=\"http\:\/\/web\.resource\.org\/cc\/\"\n    xmlns\:dc\=\"http\:\/\/purl\.org\/dc\/elements\/1\.1\/\"\n    xmlns\:rdf\=\"http\:\/\/www\.w3\.org\/1999\/02\/22\-rdf\-syntax\-ns\#\"\>\n\<Work rdf\:about\=\"\"\>\n   \<dc\:creator\>\<Agent\>\n      \<dc\:title\>Celeste Hutchins\<\/dc\:title\>\n   \<\/Agent\>\<\/dc\:creator\>\n   \<dc\:type rdf\:resource\=\"http\:\/\/purl\.org\/dc\/dcmitype\/StillImage\" \/\>\n   \<license rdf\:resource\=\"http\:\/\/creativecommons.org\/licenses\/by\/2\.0\/\" \/\>\n\<\/Work\>\n\n\<License rdf\:about\=\"http\:\/\/creativecommons\.org\/licenses\/by\/2\.0\/\"\>\n   \<permits rdf\:resource\=\"http\:\/\/web\.resource\.org\/cc\/Reproduction\" \/\>\n   \<permits rdf\:resource\=\"http\:\/\/web\.resource\.org\/cc\/Distribution\" \/\>\n   \<requires rdf\:resource\=\"http\:\/\/web\.resource\.org\/cc\/Notice\" \/\>\n   \<requires rdf\:resource\=\"http\:\/\/web\.resource\.org\/cc\/Attribution\" \/\>\n   \<permits rdf\:resource\=\"http\:\/\/web\.resource\.org\/cc\/DerivativeWorks\" \/\>\n\<\/License\>\n\n\<\/rdf\:RDF\>\n\n\-\-\>\<br \/\>\n\nblog\: <a href\=\"http\:\/\/celesteh\.blogspot\.com\"\>celesteh.blogspot.com\<\/a\>\<br \/\>\nprofessional\: \<a href\=\"http\:\/\/www\.berkeleynoise\.com\/celesteh\"\>www\.berkeleynoise\.com\/celesteh\<\/a\>\<br \/\>\nfeed\: <a href\=\"http\:\/\/www\.celesteh\.com\/pics\/atom\.xml\"\>www\.celesteh\.com\/pics\/atom\.xml<\/a\>\n\<\/address\>\<\/html\>/i' *

/usr/bin/perl -pli~ -e 's/\[br\]/\<BR \/\>\n/i' *

/usr/bin/perl -pli~ -e 's/\<\/h2\>/\<\/h2\>\n\<p\>\<a href\=\"..\/\"\>Up to Photo Library\<\/a\>\<\/p\>/i' {$1.html,Page*.html}
rm *~
cd ../..
./comm.pl  pics/$1/$1-Pages/*

