But let your communication be Yea, yea; Nay, nay: for whatsoever is more than these cometh of evil
Monday, December 31st, 2007

Baut Eure Städte an den Vesuv

If computers don’t lie, here are some stats for 2007: I read (Show me more…)

Thursday, December 27th, 2007

A little gift from Science Surf

There are many ways how to accidentially duplicate files: storing multiple mail attachments, copying or restoring files to a wrong directory. Here is a simple way (Show me more…)

Thursday, December 27th, 2007

Children research

Spiegel online reports a Pubmed listed study in the Deutsche Medizinische Wochenschrift by 14 and 12 year old authors. Having supervised such a study at Mini-München I believe that this not so spectacular as the DMW is now marketing this event. The DMW has been one of the most renown journals here. As a medical student I even had a full subscription while today the impact is being low (0.58) and needs some marketing tricks.

Thursday, December 27th, 2007

Outlook calendar export

It should be quite easy to export Outlook appointments into .ics format and let third party applications like phpicalendar stitch these snippets together into a coherent view. Unfortunately older Outlook versions are not supporting ics export. After several frustrating attempts (installing VB macros that are buggy and software like freemical that misses important fields) I finally wrote my own exporter that includes also a category filter as otherwise too may entries will have to be parsed by phpicalendar.

ol2ics.zip includes the source perl script including a compiled windows version.

 1:
 2:
 3:
 4:
 5:
 6:
 7:
 8:
 9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
62:
# ol2ics.pl outlook to ics export
# m@wjst.de 26Dec07
# ------------------------------------------------------------
#!/usr/local/bin/perl

if ($ARGV[0] eq "") {
    print ("OL2ICS export.ics categoryname\n");
    exit(1);
}

open(OUT,">$ARGV[0]");
print OUT ("BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//RSB//ICSCATEG//EN\n");
$b="BEGIN:VEVENT\n";
$e="END:VEVENT\n";

use Win32::OLE;
use Win32::OLE::Const 'Microsoft Outlook';

my $outlook = Win32::OLE->new('Outlook.Application') or die "Error!\n";
my $namespace = $outlook->GetNamespace("MAPI") or die "can't open MAPI namespace\n";;
my $folder = $namespace->GetDefaultFolder(olFolderCalendar);

my $items = $folder->Items;
for my $itemIndex (1..$items->Count) {
    my $message = $items->item($itemIndex);
    next if not defined $message;

    $s="SUMMARY:" . $message->{Subject} . "\n";
    # $message->{Body}
    # $message->{IsRecurring}

    $l="LOCATION:" . $message->{Location} . "\n";
    if ($message->{AllDayEvent} eq 1) {
        $t="DTSTART;VALUE=DATE:" . $message->{Start}->Date("yyyyMMdd") . "\n";
        $d="DTEND;VALUE=DATE:" . $message->{End}->Date("yyyyMMdd") . "\n";
    } 
    else {
        $t="DTSTART:" . $message->{Start}->Date("yyyyMMdd") . "T" . $message->{Start}->Time("hhmmss") . "Z\n";
        $d="DTEND:" . $message->{End}->Date("yyyyMMdd") . "T" . $message->{End}->Time("hhmmss") . "Z\n";
    }
    $c="CATEGORIES:" . $message->{Categories} . "\n";
    if ($message->{item.Sensitivity} eq 2) {
        $p="CLASS:PRIVATE\n";
    }
    elsif ($message->{item.Sensitivity} eq 1) {
        $p="CLASS:CONFIDENTIAL\n";
    }
    else {
        $p="CLASS:PUBLIC\n";
    }
    $m="DTSTAMP:" . $message->{LastModificationTime}->Date("yyyyMMdd") . "T" . $message->{LastModificationTime}->Time("hhmmss") . "Z\n";
    $u="UID:" . $message->{EntryID} . "\n";

    if ( $c =~ /.*($ARGV[1]).*/) {
        print OUT ("$b$s$l$t$d$c$p$m$u$e");
    }
}

print OUT ("END:VCALENDAR");
close OUT;
exit(0);

The ics file may then be uploaded to the phpicalendar directory using a wput call like
wput –reupload my.ics ftp://name:password@domain.de/calendar/my.ics

Next Page »