Вопрос как сделать уведомление на сайте при изменении курса валют? И также интересно сделать график изменения.
index.html
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<link rel="stylesheet" href="css/jquery.modal.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script>
function show()
{
$.ajax({
url: "crb.php", // Путь к php скрипту который будет загружать заголовки
cache: false,
success: function(html){
$("#crb").html(html); // Блок куда будем выводить информацию
}
});
}
$(document).ready(function(){
show();
setInterval(show, 3600000); // Интервал обновления в миллисекундах 1ч = 3600000
});
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title> CRB </title>
<h1 align="center" style="color: #ffffff; background-color: #000000" >Oh my CRB</h1>
</head>
<body>
<div align="center" id="crb"></div>
</body>
</html>
crb.php
<?php
function CBR_XML_Daily_Ru() {
$json_daily_file = __DIR__.'/daily.json';
if (!is_file($json_daily_file) || filemtime($json_daily_file) < time() - 3600) {
if ($json_daily = file_get_contents('https://www.cbr-xml-daily.ru/daily_json.js')) {
file_put_contents($json_daily_file, $json_daily);
}
}
return json_decode(file_get_contents($json_daily_file));
}
$data = CBR_XML_Daily_Ru();
echo "Основные этапы разработки сайта для стоматологической клиники
Продвижение своими сайтами как стратегия роста и независимости