Skip to content

Instantly share code, notes, and snippets.

@kylehotchkiss
Created May 13, 2010 01:03
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 kylehotchkiss/399358 to your computer and use it in GitHub Desktop.
Save kylehotchkiss/399358 to your computer and use it in GitHub Desktop.
<?php
/**
*
* jQuery.whatchaDoin | iCal Proxy
* Copyright (c) 2010 Kyle Hotchkiss [Productions]
* ALL RIGHTS RESERVED
*
*/
if ( $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest' ) {
if ( isset($_GET["iCal"] ) && strpos( $_GET["iCal"], '.ics') ) {
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $_GET["iCal"]);
curl_setopt($curl, CURLOPT_HEADER, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec();
curl_close($curl);
} else {
// Please supply a legit calendar. Thank you.
}
} else {
?><!DOCTYPE html>
<html>
<head>
<title>
You tried. You failed.
</title>
<style type="text/css">
body {
font-family:'Arial', 'Helvetica', sans-serif;
font-size:12px;
margin:60px auto 0 auto;
text-align:center;
width:480px;
}
</style>
</head>
<body>
You clearly have <strong>no clue</strong> what you're doing here. Goodbye.
</body>
</html><?php
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment