Encoding newlines in iCal files

OK, looks like I’m answering my own question. The correct way to do it is to use “\n” for line breaks. Outlook did not recognize this because I had “ENCODING=quoted-printable” on the description. Once I removed that, Outlook displayed the new lines correctly. Also, to get the file to open correctly in Apple iCal, you … Read more

Parsing files (ics/ icalendar) using Python

The icalendar package looks nice. For instance, to write a file: from icalendar import Calendar, Event from datetime import datetime from pytz import UTC # timezone cal = Calendar() cal.add(‘prodid’, ‘-//My calendar product//mxm.dk//’) cal.add(‘version’, ‘2.0’) event = Event() event.add(‘summary’, ‘Python meeting about calendaring’) event.add(‘dtstart’, datetime(2005,4,4,8,0,0,tzinfo=UTC)) event.add(‘dtend’, datetime(2005,4,4,10,0,0,tzinfo=UTC)) event.add(‘dtstamp’, datetime(2005,4,4,0,10,0,tzinfo=UTC)) event[‘uid’] = ‘20050115T101010/27346262376@mxm.dk’ event.add(‘priority’, 5) cal.add_component(event) … Read more

Creating iCal Files in c#

I use DDay.Ical, its good stuff. Has the ability to open up an ical file and get its data in a nice object model. It says beta, but it works great for us. Edit Nov 2016 This library has been deprecated, but was picked up and re-released as iCal.NET by another dev. Notes about the … Read more

How do I create a link to add an entry to a calendar?

The links in Dave’s post are great. Just to put a few technical details about the google links into an answer here on SO: Google Calendar Link <a href=”http://www.google.com/calendar/event?action=TEMPLATE&text=Example%20Event&dates=20131124T010000Z/20131124T020000Z&details=Event%20Details%20Here&location=123%20Main%20St%2C%20Example%2C%20NY”>Add to gCal</a> the parameters being: action=TEMPLATE (required) text (url encoded name of the event) dates (ISO date format, startdate/enddate – must have both start and end … Read more

How can I use PHP to dynamically publish an ical file to be read by Google Calendar?

This should be very simple if Google Calendar does not require the *.ics-extension (which will require some URL rewriting in the server). $ical = “BEGIN:VCALENDAR VERSION:2.0 PRODID:-//hacksw/handcal//NONSGML v1.0//EN BEGIN:VEVENT UID:” . md5(uniqid(mt_rand(), true)) . “@yourhost.test DTSTAMP:” . gmdate(‘Ymd’).’T’. gmdate(‘His’) . “Z DTSTART:19970714T170000Z DTEND:19970715T035959Z SUMMARY:Bastille Day Party END:VEVENT END:VCALENDAR”; //set correct content-type-header header(‘Content-type: text/calendar; charset=utf-8’); header(‘Content-Disposition: … Read more

How to extract a string using JavaScript Regex?

function extractSummary(iCalContent) { var rx = /\nSUMMARY:(.*)\n/g; var arr = rx.exec(iCalContent); return arr[1]; } You need these changes: Put the * inside the parenthesis as suggested above. Otherwise your matching group will contain only one character. Get rid of the ^ and $. With the global option they match on start and end of the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)