Skip to content

Instantly share code, notes, and snippets.

@icco
Forked from anonymous/index.php
Created May 3, 2011 19:53
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 icco/954087 to your computer and use it in GitHub Desktop.
Save icco/954087 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>
@icco
Copy link
Author

icco commented May 3, 2011

I created this originally, but apparently gist on my server didn't have my github token...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment