Skip to content

Instantly share code, notes, and snippets.

Created May 3, 2011 19:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/954084 to your computer and use it in GitHub Desktop.
Save anonymous/954084 to your computer and use it in GitHub Desktop.
<?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