Ejemplo n.º 1
0
 function __construct($secretKey)
 {
     Unirest\Request::verifyPeer(false);
     $this->secretKey = $secretKey;
     $this->resetRequest();
 }
Ejemplo n.º 2
0
    $app->render('codelouisville.twig');
});
$app->get('/pantryApp', function () use($app) {
    $app->render('pantryApp.twig');
});
$app->get('/recipeApp', function () use($app) {
    $app->render('recipeApp.twig');
    $data = $response->body->hits;
    try {
        foreach ($data as $recipe) {
            echo '<li class="panel">' . "Label: " . $recipe->recipe->label . '<br>' . 'Source: ' . $recipe->recipe->source . '<br>' . $recipe->recipe->uri . '<br>' . $recipe->recipe->url . '</li>';
        }
    } catch (Exception $e) {
        echo $e->getMessage();
    }
    Unirest\Request::verifyPeer(false);
    // These code snippets use an open-source library. http://unirest.io/php
    $response = Unirest\Request::get("https://edamam-recipe-search-and-diet-v1.p.mashape.com/search?_app_id=691b076d&_app_key=3e8c229f325ab89e7d270b29c8294a35&q={$_POST['item_name']}", array("X-Mashape-Key" => "XU83D7WqBomshL1uFNq7KVvGMz8Wp1IGNqzjsnUgU0fQWqPRk1", "Accept" => "application/json"));
});
//DATAENTRY FORM
require "/databaseConnect/databaseConnectionPantry.php";
//DATABASE CONNECTION
//DATABASE POST VARIABLES SET
$app->get('/dataEntryForm', function () use($app) {
    $app->render('dataEntryForm.twig');
    //!FORM DATA VALIDATION NEEDS ADDRESSED; IF () PARAMETERS NOT LOGICAL SOUND!
    try {
        if ($_POST['submit'] = true) {
            $itemName = $_POST['item_name'];
            $itemCount = $_POST['count'];
            $itemDesc = $_POST['description'];