#!/usr/bin/perl -w # # pop2ical.pl - Converts calendar markings from TUT POP xml to iCal format. # # This program is free software. It comes without any warranty, to # the extent permitted by applicable law. You can redistribute it # and/or modify it under the terms of the Do What The Fuck You Want # To Public License, Version 2, as published by Sam Hocevar. See # http://sam.zoy.org/wtfpl/COPYING for more details. use strict; use Date::Manip qw(ParseDate UnixDate); my %dtls; print <) { if (/^ <([^>]+)>([^<]*)/) { my $t = $dtls{'BeginTime'}; $t =~ tr/./:/; my $d = $dtls{'StartDate'}; $d =~ s/^([0-9]+)\.([0-9]+)\./$2.$1./; my $date = ParseDate($d . " " . $t); my $bd = UnixDate($date, "%Y%m%dT%H%M%S%z"); $t = $dtls{'EndTime'}; $t =~ tr/./:/; $d = $dtls{'EndDate'}; $d =~ s/^([0-9]+)\.([0-9]+)\./$2.$1./; $date = ParseDate($d . " " . $t); my $ed = UnixDate($date, "%Y%m%dT%H%M%S%z"); $t = $dtls{'Title'}; my $l = $dtls{'Location'}; print <