Last active
December 31, 2015 02:29
-
-
Save gnomus/7921604 to your computer and use it in GitHub Desktop.
Fix Engelsystem.de iCal Export for Google Calendar subscribe.
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
<?php | |
$url = 'https://engelsystem.de/30c3/?p=ical&key=<yourapikey>'; //The URL | |
$curl = curl_init(); | |
curl_setopt($curl, CURLOPT_URL, $url); | |
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); //Accept the invalid certificate | |
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); //push ical into variable | |
$result = curl_exec($curl); //fetch it! | |
curl_close($curl); | |
header("Content-Type: text/Calendar"); //return the right mime-type | |
header("Content-Disposition: inline; filename=engelsystem.ics"); | |
$trimmed = trim($result, "\x0A"); //remove "\n" at beginning of File | |
echo($trimmed); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment