~mro/Photos2Atom

d7ee885a57e8b385fe0b7fb2b8eb8a3a50abefdd — Marcus Rohrmoser 8 years ago 1f53026
validate and format resulting atom xml. refs #1
1 files changed, 12 insertions(+), 3 deletions(-)

M run.sh
M run.sh => run.sh +12 -3
@@ 30,15 30,24 @@ script_dir="$(pwd)"
########################################################
## Adjust below as appropriate

bundle exec ruby Photos2Atom.rb 'Foo'	"http://example.com/wherever/foo/" &
bundle exec ruby Photos2Atom.rb 'Bar'	"http://example.com/somewhereelse/bar/" &
bundle exec ruby Photos2Atom.rb 'Foo' "http://example.com/wherever/foo/" &
bundle exec ruby Photos2Atom.rb 'Bar' "http://example.com/somewhereelse/bar/" &

wait

# put html assets in place for deployment:
find "${HOME}/Library/Caches/name.mro.iPhoto2Atom" -type d -name "200p" -exec rsync --delete -a assets "{}/.." \;
# run atom xml through xmllint:
find "${HOME}/Library/Caches/name.mro.iPhoto2Atom" -type f -name "photos.atom" | while read atom
do
  {
    xmllint --relaxng rfc4287.rng --encode utf-8 --nonet --format --output "$atom"~ "$atom" >/dev/null \
    && touch -r "$atom" "$atom"~ \
    && mv "$atom"~ "$atom"
  }
done

# xmllint -format -relaxng rfc4287.rng -noout "${HOME}/Library/Caches/name.mro.iPhoto2Atom/example.com/foo/album0/photos.atom"
wait

# deploy to production
rsynv -avPz --delete "${HOME}/Library/Caches/name.mro.iPhoto2Atom/example.com/" "example.com:/var/www/.../example.com/public_html/"