/**
  * Get file list from boiler
  *
  * @return json this list
  */
 public function getFileFromChaudiere()
 {
     $r['response'] = true;
     $htmlCode = file_get_contents('http://' . CHAUDIERE . URL);
     $dom = new DOMDocument();
     $dom->LoadHTML($htmlCode);
     $links = $dom->GetElementsByTagName('a');
     $t_href = array();
     foreach ($links as $a) {
         $href = $a->getAttribute('href');
         if (preg_match("/csv/i", $href)) {
             array_push($t_href, array("file" => trim(str_replace(URL . "/", "", $href)), "url" => 'http://' . CHAUDIERE . $href));
         }
     }
     $r['listefiles'] = $t_href;
     $this->sendResponse($r);
 }
Example #2
0
<?php

session_start();
?>

<?php 
$destinationName = $_SESSION["destName"];
$destinationDistance = $_SESSION["destDist"];
$myLat = $_SESSION["myLat"];
$myLong = $_SESSION["myLong"];
$iter = 0;
$URL = "https://maps.googleapis.com/maps/api/place/nearbysearch/xml?location=" . $myLat . "," . $myLong . "&radius=" . $destinationDistance . "&name=" . $destinationName . "&types=food&key=AIzaSyB7mF6y0BARNA80IKOT1zGwG5fw4XhqBew";
$doc = new DOMDocument();
$doc->load($URL);
$items = $doc->GetElementsByTagName('result');
$names = [];
$lats = [];
$longs = [];
if ($items->length == 0) {
    ?>
		<head>
		<meta charset= "utf -8" >
		<title> GitGrub </title>
		<style>
			input.locationfield {
				width: 2000px;
			}
		
		
			body{
			min-width: 100%;