<?php require_once 'weatherdressed.php'; $core = new WeatherDressed(); $json = file_get_contents('php://input'); if (isset($json) && $json !== '' && $json !== NULL) { $obj = json_decode($json); $requestType = $obj->request->type; $intent = $obj->request->intent->name; $date = $obj->request->intent->slots->date->value; } else { //fallback for testing $intent = "HelpIntent"; // $intent = "GetForecast"; // $date = '2016-02-14'; } if ($intent == "HelpIntent") { $json = $core->getHelpResponse(); } elseif ($intent == "GetForecast") { $json = $core->alexaForecast(false, $date); } else { $json = $core->alexaForecast(true); } /* Output header */ header('Content-type: application/json'); echo $json;
<?php require_once 'core.php'; $core = new WeatherDressed(); error_reporting(3); $zip = $_GET['zip']; if ($zip == NULL) { $zip = 29464; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content=""> <link rel="icon" type="image/icon" href="img/favicon.ico"> <title>Weather Dressed | Robot Armies Development Site</title> <!-- Bootstrap Core CSS --> <link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet" type="text/css"> <!-- Fonts --> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"> <link href='http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Roboto:400|Englebert' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Poppins' rel='stylesheet' type='text/css'>