HI,

below is a bit of a hack i've come up with to attempt to read my
google calendar into my org agenda. I originally started it using
eldav, but i realised i don't have a webdav server to sync to. At the
moment, It only works for entries that icalendar-import-file converts
to %%(add something).

The org docs imply that that is the only diary entry type that it can
process, is this the case?

Tim.

--- code snip ---
(require 'w3)
(require 'icalendar)

(setq google-ical-org-list
     '(
       ("http://www.google.com/calendar/ical/basic.ics";
        "~/gettingThingsDone/CalendarPersonal.ics"
        "~/gettingThingsDone/CalendarPersonal.org")
       ("http://www.google.com/calendar/ical/basic.ics";
        "~/gettingThingsDone/CalendarShared.ics"
        "~/gettingThingsDone/CalendarShared.org")
       ))

(defun toc:goggle-to-org ()
 "get a google calendar and convert it into org dates"
 (interactive)
 (with-temp-buffer
   (let* ((glist google-ical-org-list))
     ;; iterate through list
     (while (setq entry (pop glist))
       (setq google-ical-url (car entry) local-ical-file (nth 1
entry) local-date-file (nth 2 entry))
       ;; Delete the diary local files
       (if (file-exists-p local-ical-file) (delete-file local-ical-file))
       (if (file-exists-p local-date-file) (delete-file local-date-file))
       ;; Get ical file
       (w3-download-url google-ical-url (expand-file-name local-ical-file)
      ;; convert to diary without leading &
       (icalendar-import-file local-ical-file local-date-file nil)
      ;; iCalendar leaves the buffers open
       (kill-buffer (find-buffer-visiting local-date-file))
       (kill-buffer (find-buffer-visiting local-ical-file))
       ))))
--- code snip ---


_______________________________________________
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to