diff --git a/api.php b/api.php
index d9f22550..9b6c0da3 100644
--- a/api.php
+++ b/api.php
@@ -43,6 +43,10 @@
$data = array_merge($data, getQuerySources());
}
+ if (isset($_GET['getAllQueries'])) {
+ $data = array_merge($data, getAllQueries());
+ }
+
echo json_encode($data);
?>
diff --git a/data.php b/data.php
index 1eb647ce..e57f2fc4 100644
--- a/data.php
+++ b/data.php
@@ -117,6 +117,26 @@
return $sources;
}
+ function getAllQueries() {
+ $allQueries = array("data" => array());
+ $log = readInLog();
+ $dns_queries = getDnsQueries($log);
+
+ foreach ($dns_queries as $query) {
+ $time = date_create(substr($query, 0, 16), new DateTimeZone('GMT'))->SetTimeZone(new DateTimeZone(date_default_timezone_get()));
+
+ $exploded = explode(" ", trim($query));
+ array_push($allQueries['data'], array(
+ $time->format('Y-m-d\TH:i:s'),
+ substr($exploded[4], 6, -1),
+ $exploded[5],
+ $exploded[7],
+ ));
+ }
+
+ return $allQueries;
+ }
+
/******** Private Members ********/
function readInBlockList() {
global $domains;
diff --git a/footer.html b/footer.html
index 70029a1f..593fe100 100644
--- a/footer.html
+++ b/footer.html
@@ -14,7 +14,8 @@
-
+
+