-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcurl.php
38 lines (34 loc) · 1.58 KB
/
curl.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
// echo "<table border='1' class='mainhati'>";
// $url = 'http://gilabola.com/internasional/jadwal-bola-malam-ini/';
// $content = file_get_contents($url);
// $first_step = explode( '<tbody class="row-hover">' , $content );
// $second_step = explode("</tbody>" , $first_step[1] );
// $text1 = $second_step[0];
// echo $text1;
// echo "</table>";
//
?>
<div id='map' style='height:380px;' />
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.5/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.5/leaflet.js"></script>
<script>
var yourUrl = 'https://api.waqi.info/feed/pekanbaru/?token=ec5f593741128eea9cf875ffe9ac9fb47bf753ef';
let jsondata;
fetch(yourUrl).then(
function(u){ return u.json();}
).then(
function(json){
jsondata = json;
alert(jsondata);
}
)
// var OSM_URL = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
// var OSM_ATTRIB = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors';
// var osmLayer = L.tileLayer(OSM_URL, {attribution: OSM_ATTRIB});
// var WAQI_URL = "https://tiles.waqi.info/tiles/usepa-aqi/{z}/{x}/{y}.png?token=ec5f593741128eea9cf875ffe9ac9fb47bf753ef";
// var WAQI_ATTR = 'Air Quality Tiles © <a href="http://waqi.info">waqi.info</a>';
// var waqiLayer = L.tileLayer(WAQI_URL, {attribution: WAQI_ATTR});
// var map = L.map('map').setView([51.505, -0.09], 11);
// map.addLayer(osmLayer).addLayer(waqiLayer);
</script>ulang sda