emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Tim O'Callaghan" <timo@dspsrv.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: iCal Import
Date: Tue, 19 Jun 2007 19:26:55 +0200	[thread overview]
Message-ID: <3d6808890706191026w4dcdff34kbbb3be8f2272f647@mail.gmail.com> (raw)

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 ---

             reply	other threads:[~2007-06-19 17:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-19 17:26 Tim O'Callaghan [this message]
2007-06-20 11:59 ` iCal Import Rick Moynihan
2007-06-20 12:23   ` Tim O'Callaghan
2007-06-20 13:04     ` Rick Moynihan
     [not found]       ` <3d6808890706200717o6f8e18d7gc1ac28e492f7481b@mail.gmail.com>
2007-06-20 14:18         ` Tim O'Callaghan
2007-06-21  9:29 ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3d6808890706191026w4dcdff34kbbb3be8f2272f647@mail.gmail.com \
    --to=timo@dspsrv.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).