Complete Computing Environment: Google Calendar

Table of Contents

Getting Org-mode scheduled events from Google Calendar

org-gcal1 lets you pull Google Calendar data in to and out of Org-mode. I used org-caldav for the longest time, but this seems like it is more featureful and reliable than that, so we're going to try this for a while. Make sure you follow the directions, it relies on creating a Google developer account and supplying a client id and client secret which you can use to OAuth with.

(provide 'cce-gcal)
(install-pkgs '(org-gcal))
(require 'org-gcal)

I only use my work calendars right now for this, and I keep the values in the Customize system to keep them out of Git.

(setq org-gcal-auto-archive t)
(setq org-gcal-down-days 30)
(setq org-gcal-up-days 30)

org-gcal uses the calendar's timezone by default, this makes sure those end up in UTC.

(defun cce/clean-up-gcal-timestamps ()
  (dolist (cal-cons org-gcal-file-alist)
    (let ((filename (cdr cal-cons)))
      (with-current-buffer (find-file-noselect filename t)
        (revert-buffer t t)
        (insert "#+FILETAGS: WORK\n")

(defun cce/gcal-fix-bad-events ()
  (when (re-search-forward "[a-zA-Z0-9 ]+\\*" nil t)
    (backward-char 1)
    (insert "\n")

Getting Org-mode scheduled events from Facebook and Meetup

(defun cce/fetch-private-calendars ()
    (async-shell-command "awk -f ~/org/ical2org.awk <(curl $(cat ~/sync/private-files/meetup-private-url)) >" (get-buffer-create " *meetup fetch*")))
    (async-shell-command "awk -f ~/org/ical2org.awk <(curl $(cat ~/sync/private-files/facebook-private-url)) >" (get-buffer-create " *fb fetch*"))))


Author: Ryan Rix

Created: 2018-05-31 Thu 17:32

Validate XHTML 1.0