From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Tim O'Callaghan" Subject: iCal Import Date: Tue, 19 Jun 2007 19:26:55 +0200 Message-ID: <3d6808890706191026w4dcdff34kbbb3be8f2272f647@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I0hTn-0006zZ-DA for emacs-orgmode@gnu.org; Tue, 19 Jun 2007 13:26:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I0hTl-0006zL-0H for emacs-orgmode@gnu.org; Tue, 19 Jun 2007 13:26:58 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I0hTk-0006zI-R5 for emacs-orgmode@gnu.org; Tue, 19 Jun 2007 13:26:56 -0400 Received: from ug-out-1314.google.com ([66.249.92.168]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I0hTk-00032q-G6 for emacs-orgmode@gnu.org; Tue, 19 Jun 2007 13:26:56 -0400 Received: by ug-out-1314.google.com with SMTP id 34so178106ugf for ; Tue, 19 Jun 2007 10:26:55 -0700 (PDT) Content-Disposition: inline List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode 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 ---