pull-ical-files 374 B

123456789101112131415161718
  1. #!/bin/sh
  2. OUTPUT_FILE=~/org/ical.org
  3. while read cal ; do
  4. URL=$(echo $cal | awk -e '{print $1}')
  5. OUT=$(echo $cal | awk -e '{print $2}')
  6. OUT=${OUT:-${OUTPUT_FILE}}
  7. TEMP=$(mktemp)
  8. wget $URL -O "${TEMP}"
  9. ical2org-awk "${TEMP}" "${OUT}"
  10. rm "${TEMP}"
  11. done <~/.dotfiles/ical.txt
  12. cd ~/org || exit 1
  13. git add ical.org
  14. git commit -m "Pulled ical files"