Last active
January 6, 2017 01:17
-
-
Save artyom-poptsov/5d781ee0cfcc4201726fcaa27777c244 to your computer and use it in GitHub Desktop.
Example of Guile-ICS (https://github.com/artyom-poptsov/guile-ics) usage: Convert iCalendar data to Emacs org-mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/guile \ | |
-e main | |
!# | |
(use-modules (ice-9 popen) | |
(srfi srfi-41) ; streams | |
;; Guile-ICS | |
(ics) | |
(ics conv)) | |
(setlocale LC_ALL "") | |
(define (main args) | |
;; We have to use 'curl' because 'http-get' from (web client) does | |
;; not work with HTTPS. | |
(let ((p (open-input-pipe "curl 'https://fosdem.org/2017/schedule/ical'"))) | |
(stream-for-each ical-object->org-mode (ics->stream p)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat rfc5545-example.ics | ./utils/ics --to-org-mode | |
* VCALENDAR | |
:PROPERTIES: | |
:PRODID: -//hacksw/handcal//NONSGML v1.0//EN | |
:VERSION: 2.0 | |
:END: | |
** VEVENT | |
:PROPERTIES: | |
:SUMMARY: Bastille Day Party | |
:DTEND: 19970715T040000Z | |
:DTSTART: 19970714T170000Z | |
:DTSTAMP: 19970610T172345Z | |
:UID: 19970610T172345Z-AF23B2@example.com | |
:END: | |
$ cat rfc5545-example.ics | ./utils/ics --pretty-print | |
BEGIN: VCALENDAR | |
PRODID: -//hacksw/handcal//NONSGML v1.0//EN | |
VERSION: 2.0 | |
BEGIN: VEVENT | |
SUMMARY: Bastille Day Party | |
DTEND: 19970715T040000Z | |
DTSTART: 19970714T170000Z | |
DTSTAMP: 19970610T172345Z | |
UID: 19970610T172345Z-AF23B2@example.com | |
END: VEVENT | |
END: VCALENDAR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN:VCALENDAR | |
VERSION:2.0 | |
PRODID:-//hacksw/handcal//NONSGML v1.0//EN | |
BEGIN:VEVENT | |
UID:19970610T172345Z-AF23B2@example.com | |
DTSTAMP:19970610T172345Z | |
DTSTART:19970714T170000Z | |
DTEND:19970715T040000Z | |
SUMMARY:Bastille Day Party | |
END:VEVENT | |
END:VCALENDAR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment