network check script
This commit is contained in:
43
misc/latest_dweets.html
Normal file
43
misc/latest_dweets.html
Normal file
@@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<script src="https://code.jquery.com/jquery-2.2.3.min.js"></script>
|
||||
<style>
|
||||
body {
|
||||
background: #F9F9FA;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<a href="#" id="get-data">Get JSON data</a>
|
||||
<div id="show-data"></div>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#get-data').click(function() {
|
||||
var showData = $('#show-data');
|
||||
|
||||
$.getJSON('https://dweet.io:443/get/dweets/for/5410ab1e-319c-4f14-a2e4-04725df69121', function(data) {
|
||||
console.log(data);
|
||||
|
||||
var items = data.with.map(function(item) {
|
||||
return item.created + ': ' + item.content.controller_id + ' (' + item.content.message + ')';
|
||||
});
|
||||
|
||||
showData.empty();
|
||||
|
||||
if (items.length) {
|
||||
var content = '<li>' + items.join('</li><li>') + '</li>';
|
||||
var list = $('<ul />').html(content);
|
||||
showData.append(list);
|
||||
}
|
||||
});
|
||||
|
||||
showData.text('Loading the JSON file.');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
24
misc/latest_dweets.js
Normal file
24
misc/latest_dweets.js
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
$(document).ready(function () {
|
||||
$('#get-data').click(function () {
|
||||
var showData = $('#show-data');
|
||||
|
||||
$.getJSON('https://dweet.io:443/get/dweets/for/5410ab1e-319c-4f14-a2e4-04725df69121', function (data) {
|
||||
console.log(data);
|
||||
|
||||
var items = data.items.map(function (item) {
|
||||
return item.key + ': ' + item.value;
|
||||
});
|
||||
|
||||
showData.empty();
|
||||
|
||||
if (items.length) {
|
||||
var content = '<li>' + items.join('</li><li>') + '</li>';
|
||||
var list = $('<ul />').html(content);
|
||||
showData.append(list);
|
||||
}
|
||||
});
|
||||
|
||||
showData.text('Loading the JSON file.');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user