-
-
Save icco/954087 to your computer and use it in GitHub Desktop.
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 | |
// Git the data | |
// http://doineedanumbrella.com/api/?zip=94103 | |
$zip = "95032"; | |
if (isset($_REQUEST['body'])) { | |
$zip = $_REQUEST['body']; | |
} | |
$json = file_get_contents("http://doineedanumbrella.com/api/?zip={$zip}"); | |
$data = json_decode($json); | |
$out = isset($data->description) ? $data->description : 'invalid zip'; | |
header("content-type: text/xml"); | |
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; | |
?> | |
<Response> | |
<Sms><?php echo $out; ?></Sms> | |
</Response> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I created this originally, but apparently gist on my server didn't have my github token...