Created
November 19, 2013 11:47
-
-
Save dontcallmedom/7544230 to your computer and use it in GitHub Desktop.
Podio currently exports tasks as iCalendar events, which is both noisy in a calendar view, and doesn't make it possible to integrate them cleanly in a Todo app. This PHP code runs regexp on the iCalendar output from Podio and turns it into a list of VEVENT and VTODO depending on their category (relying on the fact that Podio uses UID prefixed wi…
This file contains hidden or 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
<?php | |
$userid= "xxxx"; // get From Podio | |
$token = "yyyy"; // get From Podio | |
$cal = file_get_contents("https://api.podio.com/calendar/ics/".$userid."/".$token."/?priority=10"); | |
$begintodo = preg_replace('/BEGIN:VEVENT((?:(?!UID:).)*UID:task)/s','BEGIN:VTODO$1',$cal); | |
$due = preg_replace('/DTSTART((?:(?!UID:).)*UID:task)/s','DUE$1',$begintodo); | |
$endtodo = preg_replace('/(UID:task(?:(?!END:VEVENT).)*)END:VEVENT/s', '$1END:VTODO', $due); | |
print $endtodo; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment