Skip to content

Instantly share code, notes, and snippets.

@gnomus
Last active December 31, 2015 02:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gnomus/7921604 to your computer and use it in GitHub Desktop.
Save gnomus/7921604 to your computer and use it in GitHub Desktop.
Fix Engelsystem.de iCal Export for Google Calendar subscribe.
<?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