all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* iCal Import
@ 2007-06-19 17:26 Tim O'Callaghan
  2007-06-20 11:59 ` Rick Moynihan
  2007-06-21  9:29 ` Carsten Dominik
  0 siblings, 2 replies; 6+ messages in thread
From: Tim O'Callaghan @ 2007-06-19 17:26 UTC (permalink / raw)
  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 ---

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: iCal Import
  2007-06-19 17:26 iCal Import Tim O'Callaghan
@ 2007-06-20 11:59 ` Rick Moynihan
  2007-06-20 12:23   ` Tim O'Callaghan
  2007-06-21  9:29 ` Carsten Dominik
  1 sibling, 1 reply; 6+ messages in thread
From: Rick Moynihan @ 2007-06-20 11:59 UTC (permalink / raw)
  To: Tim O'Callaghan; +Cc: emacs-orgmode

I'm quite excited by the Google calendar/iCal integration.  I had 
previously written a simple Ruby script (I really need to learn elisp) 
to parse an org-mode file for dates and schedule some "at" jobs to fire 
another script to fire events into Twitter, which I was subsequently 
using as a free SMS reminder service.

It worked quite well in simple tests, but I've never bothered to develop 
it further, primarily because it occured to me that google calendar 
supports free SMSing of notifications and that this could potentially be 
tied into org-mode with the g-client code.

It seems that your code is about getting gcal into org-mode where as the 
above would require the reverse.  Obviously the ideal would be to have 
some level of two-way Calendar synchronisation.  Though this might be 
far too complex and messy, how about allowing some kind of emacs based 
copy/paste between them (in both directions)?

The thought of managing myself in org-mode and syncing to Gcal when I 
want to share/expose my calendar to others is a tempting proposition; I 
imagine this coupled with SMS reminders would be great.

Anyway, as my elisp skills are no more advanced than being able to copy 
and paste fragments of elisp; I thought I'd post my ideas to see whether 
anyone else finds them interesting enough to implement.

R.

Tim O'Callaghan wrote:
> 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
> 


-- 
Rick Moynihan
Software Engineer
Calico Jack LTD
http://www.calicojack.co.uk/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: iCal Import
  2007-06-20 11:59 ` Rick Moynihan
@ 2007-06-20 12:23   ` Tim O'Callaghan
  2007-06-20 13:04     ` Rick Moynihan
  0 siblings, 1 reply; 6+ messages in thread
From: Tim O'Callaghan @ 2007-06-20 12:23 UTC (permalink / raw)
  To: emacs-orgmode

The code could be adapted to write iCal information, but AFAIKT Google
does not allow WEBDAV write operations. At the moment i am using
Google Calendar as my main appointment calendar, and org mode for
scheduling tasks etc.

If you want to sync to an iCal WEBDAV source an example of how its
done can be seen here:
http://www.emacswiki.org/cgi-bin/wiki/ElDav

You can only write to a Google Calendar with by using its gData
ATOM/RSS based protocol. There are some free client libraries, but i
have not looked into it in much detail.

Tim.

On 20/06/07, Rick Moynihan <rick@calicojack.co.uk> wrote:
> I'm quite excited by the Google calendar/iCal integration.  I had
> previously written a simple Ruby script (I really need to learn elisp)
> to parse an org-mode file for dates and schedule some "at" jobs to fire
> another script to fire events into Twitter, which I was subsequently
> using as a free SMS reminder service.
>
> It worked quite well in simple tests, but I've never bothered to develop
> it further, primarily because it occured to me that google calendar
> supports free SMSing of notifications and that this could potentially be
> tied into org-mode with the g-client code.
>
> It seems that your code is about getting gcal into org-mode where as the
> above would require the reverse.  Obviously the ideal would be to have
> some level of two-way Calendar synchronisation.  Though this might be
> far too complex and messy, how about allowing some kind of emacs based
> copy/paste between them (in both directions)?
>
> The thought of managing myself in org-mode and syncing to Gcal when I
> want to share/expose my calendar to others is a tempting proposition; I
> imagine this coupled with SMS reminders would be great.
>
> Anyway, as my elisp skills are no more advanced than being able to copy
> and paste fragments of elisp; I thought I'd post my ideas to see whether
> anyone else finds them interesting enough to implement.
>
> R.
>
> Tim O'Callaghan wrote:
> > 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
> >
>
>
> --
> Rick Moynihan
> Software Engineer
> Calico Jack LTD
> http://www.calicojack.co.uk/
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: iCal Import
  2007-06-20 12:23   ` Tim O'Callaghan
@ 2007-06-20 13:04     ` Rick Moynihan
       [not found]       ` <3d6808890706200717o6f8e18d7gc1ac28e492f7481b@mail.gmail.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Rick Moynihan @ 2007-06-20 13:04 UTC (permalink / raw)
  To: Tim O'Callaghan; +Cc: emacs-orgmode

I think you're right about Google not accepting WEBDAV write operations, 
and their gData protocol is definitely the way to go for now.  The 
g-client code I mentioned is an Emacs lisp library providing integration 
with a variety of Google services including Gcal.

http://emacsgeek.blogspot.com/2007/03/updates-to-g-client.html

You can download it from it's svn repository:

http://emacspeak.googlecode.com/svn/trunk/lisp/g-client/

And there is a google group for the project here:

http://groups.google.com/group/emacs-g-client/

R.

Tim O'Callaghan wrote:
> The code could be adapted to write iCal information, but AFAIKT Google
> does not allow WEBDAV write operations. At the moment i am using
> Google Calendar as my main appointment calendar, and org mode for
> scheduling tasks etc.
> 
> If you want to sync to an iCal WEBDAV source an example of how its
> done can be seen here:
> http://www.emacswiki.org/cgi-bin/wiki/ElDav
> 
> You can only write to a Google Calendar with by using its gData
> ATOM/RSS based protocol. There are some free client libraries, but i
> have not looked into it in much detail.
> 
> Tim.
> 
> On 20/06/07, Rick Moynihan <rick@calicojack.co.uk> wrote:
>> I'm quite excited by the Google calendar/iCal integration.  I had
>> previously written a simple Ruby script (I really need to learn elisp)
>> to parse an org-mode file for dates and schedule some "at" jobs to fire
>> another script to fire events into Twitter, which I was subsequently
>> using as a free SMS reminder service.
>>
>> It worked quite well in simple tests, but I've never bothered to develop
>> it further, primarily because it occured to me that google calendar
>> supports free SMSing of notifications and that this could potentially be
>> tied into org-mode with the g-client code.
>>
>> It seems that your code is about getting gcal into org-mode where as the
>> above would require the reverse.  Obviously the ideal would be to have
>> some level of two-way Calendar synchronisation.  Though this might be
>> far too complex and messy, how about allowing some kind of emacs based
>> copy/paste between them (in both directions)?
>>
>> The thought of managing myself in org-mode and syncing to Gcal when I
>> want to share/expose my calendar to others is a tempting proposition; I
>> imagine this coupled with SMS reminders would be great.
>>
>> Anyway, as my elisp skills are no more advanced than being able to copy
>> and paste fragments of elisp; I thought I'd post my ideas to see whether
>> anyone else finds them interesting enough to implement.
>>
>> R.
>>
>> Tim O'Callaghan wrote:
>> > 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
>> >
>>
>>
>> -- 
>> Rick Moynihan
>> Software Engineer
>> Calico Jack LTD
>> http://www.calicojack.co.uk/
>>
> 
> 
> _______________________________________________
> Emacs-orgmode mailing list
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
> 


-- 
Rick Moynihan
Software Engineer
Calico Jack LTD
http://www.calicojack.co.uk/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: iCal Import
       [not found]       ` <3d6808890706200717o6f8e18d7gc1ac28e492f7481b@mail.gmail.com>
@ 2007-06-20 14:18         ` Tim O'Callaghan
  0 siblings, 0 replies; 6+ messages in thread
From: Tim O'Callaghan @ 2007-06-20 14:18 UTC (permalink / raw)
  To: emacs-orgmode

It would seem that the author of g-client is already an org mode user.
At least there is an org file in the source distribution. So it might
include org integration at some point.

Tim

On 20/06/07, Rick Moynihan <rick@calicojack.co.uk> wrote:
> I think you're right about Google not accepting WEBDAV write operations,
> and their gData protocol is definitely the way to go for now.  The
> g-client code I mentioned is an Emacs lisp library providing integration
> with a variety of Google services including Gcal.
>
> http://emacsgeek.blogspot.com/2007/03/updates-to-g-client.html
>
> You can download it from it's svn repository:
>
> http://emacspeak.googlecode.com/svn/trunk/lisp/g-client/
>
> And there is a google group for the project here:
>
> http://groups.google.com/group/emacs-g-client/
>
> R.
>
> Tim O'Callaghan wrote:
> > The code could be adapted to write iCal information, but AFAIKT Google
> > does not allow WEBDAV write operations. At the moment i am using
> > Google Calendar as my main appointment calendar, and org mode for
> > scheduling tasks etc.
> >
> > If you want to sync to an iCal WEBDAV source an example of how its
> > done can be seen here:
> > http://www.emacswiki.org/cgi-bin/wiki/ElDav
> >
> > You can only write to a Google Calendar with by using its gData
> > ATOM/RSS based protocol. There are some free client libraries, but i
> > have not looked into it in much detail.
> >
> > Tim.
> >

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: iCal Import
  2007-06-19 17:26 iCal Import Tim O'Callaghan
  2007-06-20 11:59 ` Rick Moynihan
@ 2007-06-21  9:29 ` Carsten Dominik
  1 sibling, 0 replies; 6+ messages in thread
From: Carsten Dominik @ 2007-06-21  9:29 UTC (permalink / raw)
  To: Tim O'Callaghan; +Cc: emacs-orgmode


On Jun 19, 2007, at 19:26, Tim O'Callaghan wrote:

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

If you want to keep the entries in an org-mode file, yes, then you
are limited to the sexp entries.

However, if your function writes the ~/diary file,
or better a file that will be included by ~/diary,
you can have all the entries interpreted by going through
the diary, using

     (setq org-agenda-include-diary t)

- Carsten



--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-06-21  9:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-19 17:26 iCal Import Tim O'Callaghan
2007-06-20 11:59 ` 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

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.