xxxxxxxxxx
<html lang="en">
<head>
<meta charset="utf-8">
<!--Edit the title of the page-->
<title>Live currency map</title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="https://libs.cartocdn.com/cartodb.js/v3/themes/css/cartodb.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="https://libs.cartocdn.com/cartodb.js/v3/themes/css/cartodb.ie.css" />
<![endif]-->
<!--Switch between the different themes changing the stylesheet below - light-theme.css |dark-theme.css -->
<style type="text/css">
body, html, #map {width: 100%; height: 100%; margin: none; padding: none;}
#time { position: absolute; bottom: 40px; left: 20px; z-index: 1000; color: white;}
</style>
</head>
<body>
<div id="map"></div>
<div id="time"></div>
<script src="https://libs.cartocdn.com/cartodb.js/v3/cartodb.js"></script>
<script type="text/javascript">
var map;
function main() {
map = L.map('map', {
zoomControl: true,
center: [31.2034, -29.1797],
zoom: 2
})
var layer = L.tileLayer('https://{s}.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}.png',{
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="https://cartodb.com/attributions">CartoDB</a>'
});
map.addLayer(layer);
var sql = cartodb.SQL({ user: 'andrew-free' });
// add cartodb layer with one sublayer
cartodb.createLayer(map, "https://andrew-free.cartodb.com/api/v2/viz/49d67aca-fe7e-11e4-a5dc-7054d21a95e5/viz.json", {refreshTime: 1000*60*1.5})
.addTo(map)
.done(function(layer) {
sql.execute("select extract('minutes' from (now()+INTERVAL '1 hour') - max(quote_time))::text minutes FROM currencies_list").done(function(data) {
$('#time').html("Data last updated "+data.rows[0].minutes + " minutes ago")
})
});
}
window.onload = main;
</script>
</body>
</html>
Modified http://libs.cartocdn.com/cartodb.js/v3/cartodb.js to a secure url
https://libs.cartocdn.com/cartodb.js/v3/cartodb.js