[{ "ts": 1552903183141, "sk": "testing123", "val": 0, "qual": 0, "tg": "hb"}, { "ts": 1552903173141, "sk": "testing123", "val": 0, "qual": 0, "tg": "hb"}, { "ts": 1552903163141, "sk": "testing123", "val": 0, "qual": 0, "tg": "hb"}, { "ts": 1552903153141, "sk": "testing123", "val": 0, "qual": 0, "tg": "hb"}, { "ts": 1552903143141, "sk": "testing123", "val": 0, "qual": 0, "tg": "hb"}, { "ts": 1552903133141, "sk": "testing123", "val": 0, "qual": 0, "tg": "hb"}, { "ts": 1552903123141, "sk": "testing123", "val": 0, "qual": 0, "tg": "hb"}, { "ts": 1552903113141, "sk": "testing123", "val": 0, "qual": 0, "tg": "hb"}, { "ts": 1552903103141, "sk": "testing123", "val": 0, "qual": 0, "tg": "hb"}]
<html> <head> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script type="text/javascript"> google.charts.load('current', {'packages':['table']}); google.charts.setOnLoadCallback(drawTable); function drawTable() { var data = google.visualization.arrayToDataTable([ data.addColumn('string', 'sk'); data.addColumn('string', 'ts'); data.addColumn('string', 'val'); data.addColumn('string', 'qual'); data.addColumn('string', 'tg'); data.addRow([ ['<?php for ($i = 0; $i < count($json); $i++) { echo $json[$i]['sk']; echo $json[$i]['ts']; echo $json[$i]['val']; echo $json[$i]['qual']; echo $json[$i]['tg']; } ?>'] ]);
var table = new google.visualization.Table(document.getElementById('table_div'));
table.draw(data, {showRowNumber: true, width: '50%', height: '50%'}); } </script> </head> <body> </br> <div id="table_div"></div> </body></html>
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/ba547473-4b4e-423b-8fcf-0d285c3b0caf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<html> <head> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script type="text/javascript"> google.charts.load('current', {'packages':['table']}); google.charts.setOnLoadCallback(drawTable); function drawTable() {
var data = google.visualization.arrayToDataTable( JSON.parse(<?= $json ?>));
var table = new google.visualization.Table(document.getElementById('table_div'));
table.draw(data, {showRowNumber: true, width: '50%', height: '50%'}); } </script> </head> <body> </br> <div id="table_div"></div> </body></html>
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/ba547473-4b4e-423b-8fcf-0d285c3b0caf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/210be0fd-55f7-4582-a7dd-05bff5652c83%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/ba547473-4b4e-423b-8fcf-0d285c3b0caf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/ba547473-4b4e-423b-8fcf-0d285c3b0caf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/210be0fd-55f7-4582-a7dd-05bff5652c83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/fd5a27cf-91a1-4d09-a25b-40f9d806892a%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/ba547473-4b4e-423b-8fcf-0d285c3b0caf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/210be0fd-55f7-4582-a7dd-05bff5652c83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/ba547473-4b4e-423b-8fcf-0d285c3b0caf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/210be0fd-55f7-4582-a7dd-05bff5652c83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/fd5a27cf-91a1-4d09-a25b-40f9d806892a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/5e238d4b-b0fe-4df1-9c65-93017b65d3b3%40googlegroups.com.
<?phpecho "<h3>testing</h3>"; //initiate the curl request for token$curl = curl_init();//create the request array for tokencurl_setopt_array($curl, array( CURLOPT_URL => "blablabla/token?grant_type=password", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_HTTPHEADER => array( "authorization: Basic 123" ),));
$response = curl_exec($curl);$err = curl_error($curl);curl_close($curl);if ($err) { echo "cURL Error #:" . $err;} else { $json = json_decode($response, true); $token = $json['token'];}
?>
</br><form action=# method="post">Source Key: <input type="text" name="skk"></br></br>Date Start: <input type="date" name="dtstart"> (not in use yet)</br>Date End: <input type="date" name="dtend"> (not in use yet)</br><input type="submit"></form>
<?php
if(isset($_POST['submit'])){ $test = $_POST['skk'];//assigning your input value
if(isset($test)) { $fr=fopen("php://stdin","r"); // open our file pointer to read from stdin $input = fgets($fr,128); // read a maximum of 128 characters $input = rtrim($input); // trim any trailing spaces. fclose ($fr); // close the file handle $result = $input; // return the text entered } }?>
You have entered : <?php echo $_POST["skk"]; echo "</br></br>";
//set my base url for the api$myurl = "https://blablabla/admin?skk=";//set my limit $limit = "&limit=10";//create my concatenated url$endurl = $myurl.$_POST["skk"].$limit;
//send the request$curl = curl_init();curl_setopt_array($curl, array( CURLOPT_URL => $endurl, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_HTTPHEADER => array( "authorization: bearer $token" ),));
$response = curl_exec($curl);$err = curl_error($curl);curl_close($curl);if ($err) { echo "cURL Error #:" . $err;} else { $json = json_encode($json); //print_r($json);}
//create some variables for data points$ts = $json[0]['ts'];$val = $json[0]['val'];$qual = $json[0]['qual'];$tag = $json[0]['tg'];$sk = $json[0]['sk'];
//create a formatted date from timestamp for future use$formatdt = date("Y-m-d H:i:s", substr($dt, 0, 10));//whats my current date$cur_date = date("Y-m-d H:i:s");echo "</br>";
//convert back to timestamps$date1Timestamp = strtotime($formatdt);$date2Timestamp = strtotime($cur_date);
//Calculate the difference$difference = $date2Timestamp - $date1Timestamp;//echo $difference;
//tellem whats wrongif ($difference<60) { echo "<h2>" . $skk . " is <font color=green>UP </font></h2>"; } else { echo "<h2>" . $skk . " is <font color=red>DOWN </font></h2>"; }
echo "</br>";
//remove brackets//$suba = substr($json_stringa, 1, -1);//echo $suba;
?>
<html> <head> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script type="text/javascript"> google.charts.load('current', {'packages':['table']}); google.charts.setOnLoadCallback(drawTable); function drawTable() { var data = google.visualization.arrayToDataTable([ data.addColumn('string', 'sk'); data.addColumn('string', 'ts'); data.addColumn('string', 'val'); data.addColumn('string', 'qual'); data.addColumn('string', 'tg'); data.addRow([
]);
var table = new google.visualization.Table(document.getElementById('table_div'));
table.draw(data, {showRowNumber: true, width: '50%', height: '50%'}); } </script> </head> <body> </br> <div id="table_div"></div> </body></html>
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/ba547473-4b4e-423b-8fcf-0d285c3b0caf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/210be0fd-55f7-4582-a7dd-05bff5652c83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/fd5a27cf-91a1-4d09-a25b-40f9d806892a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
yes here you go.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/ba547473-4b4e-423b-8fcf-0d285c3b0caf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/210be0fd-55f7-4582-a7dd-05bff5652c83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/fd5a27cf-91a1-4d09-a25b-40f9d806892a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/5e238d4b-b0fe-4df1-9c65-93017b65d3b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/96bbc010-2b44-4498-b82e-d53e8e5eae48%40googlegroups.com.
yes here you go.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/ba547473-4b4e-423b-8fcf-0d285c3b0caf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/210be0fd-55f7-4582-a7dd-05bff5652c83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/fd5a27cf-91a1-4d09-a25b-40f9d806892a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/5e238d4b-b0fe-4df1-9c65-93017b65d3b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.