Skip to content

Instantly share code, notes, and snippets.

@dmpatierno
Created May 3, 2011 19:28
Show Gist options
  • Save dmpatierno/954034 to your computer and use it in GitHub Desktop.
Save dmpatierno/954034 to your computer and use it in GitHub Desktop.
<?php
require 'lib.php';
$_REQUEST['zip'] = $_REQUEST['Digits'];
$info = get_info();
extract($info);
$city = preg_replace("/, .*$/", "", $city);
$response = $need == 'yes' ?
" You do need an umbrella. " : " You do not need an umbrella. ";
$details = "{$description}. ";
if ($percent > 0 && $percent < 100)
$details .= "{$percent} percent chance {$period}. ";
$details .= "Currently {$temp} degrees.";
header("content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
?>
<Response>
<Say><?="{$city}:" . $response . $details . " Goodbye!"?></Say>
</Response>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment