Created
May 13, 2010 01:03
-
-
Save kylehotchkiss/399358 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* | |
* 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