· 5 years ago · Aug 24, 2020, 02:04 PM
1<!DOCTYPE html>
2<html>
3<head>
4<meta name="viewport" content="width=device-width, initial-scale=1">
5</head>
6 <body>
7 <div class="main_info">
8 <?php
9 require 'bbt.php';
10
11 $apikey = "8Lw3AjCpfYzyDfi0P3M9lZ1K";
12 $secretkey = "WDOV1FNuIxEEl29W5gf5AbRnSbxjAcxa";
13 $bclient = new Beebotte ( $apikey , $secretkey );
14 $chanel = 'sensor';
15 $topics = array('temperature', 'humidity', 'Led');
16 $i = 1;
17 while($i <= 10)
18 {
19 $i = $i +1;
20 foreach($topics as $topic)
21 {
22 $records = $bclient-> read($chanel, $topic, 1);
23 $dat = current($records)['data'];
24 echo('value of ' . $topic . ' is ' . $dat . '<br />');
25 flush();
26 ob_flush();
27 }
28 sleep(1);
29 }
30 ?>
31 </div>
32 </body>
33</html>