[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Search]

[Emacspeak] [Tip] Import Google calendar events into org agenda



Hi All,

this is just something which some of you may find useful.

If you are like me and make extensive use of org mode in Emacs, you
might find it useful to be able to import your Google calendar events
into org mode. To facilitate this, I've written a simple node script
which will retrieve your events from Google and create an org file which
you can include in your list of agenda file. Once you do this, events
will show up in your org agenda.

The homepage for this simple script is
https://github.com/theophilusx/icsorg

To install and run the script, you need a reasonably recent version of
node and NPM installed on your system. At least node v12.x is required
(though it will probably work with node v10.x). To install the script,
run

npm i -g icsorg

Depending on how you have node and NPM configured, you may need to run
this command inside sudo. (I have npm configured so that it doesn't
require sudo and can provide that info if desired). It is also expected
that the npm module bin directory is on your search path. This is
normal, but if it isn't, either you need to add it or provide a full
path when calling the script.

Once you have the script installed, you can run

icsorg -h

to get a summary of command line options and configuration file
variables. The script will search for a configuration file in your home
directory called .icsorg. The list of configuration variables are
documented on the homepage. The most important one is to set the
ICS_FILE variable to the URL to retrieve your calendar events as an .ics
file. You can find this URL by opening up the calendar options menu in
Google Calendar. Near the bottom, it has an entry for a private URL to
retrieve event data. In some cases, you may need to choose to reset the
URL (if you have never used it before and have no other integration
programs which use it). You also need to fill in the other variables,
such as specifying where to create the org file. You want the created
org file to be a file included in your org agenda.

Once you have the configuration file setup, all you need to do is run

icsorg

and it will retrieve your events and generate an org file for them. I
have this setup as a cron job which runs every 6 hours.

Note that if you don't use google and want to import from some other
source, especially one which does not provide a URL to retrieve the
events as an .ics file, you can generally export the calendar as an .ics
file, place it somewhere on your system and set the ICS_FILE variable to
the path to that file. When you then run icsorg, it will import from
that file.

Personally, I find it much more convenient to be able to see my events
in the org agenda than trying to navigate Google's calendar on the web.
Hope others might find this useful as well.

There are bound to be some bugs in this script. If you find any, either
email me with details or use the issue system on github. I've not yet
tested this on under macOS, but I expect it should work fine.

Tim


|May 1995 - Last Year|Current Year|


If you have questions about this archive or had problems using it, please contact us.

Contact Info Page