parse.php


$url = "http://www.doviz.com/api/v1/currencies/all/latest";
$jData = file_get_contents($url);
$parsed = json_decode($jData, true);
foreach ($parsed as $val) {
echo "
  • ".$val['full_name']."
    Alış Fiyatı: ".$val['buying']." ₺
    Satış Fiyatı: ".$val['selling']." ₺
  • ";
    }




    index.php





    Doviz Api | html api








    <script></script>
    <script>
    var callDoviz = function (){
    return {
    load : function (){
    $.post("http://localhost/doviz_api/parser.php",{'data' : 'me'},function(callback){
    $("#doviz-list").html(callback);
    })
    }
    }
    }();
    $(document).ready(function () {
    callDoviz.load();
    setTimeout(function(){
    setInterval(function(){
    callDoviz.load();
    },3000);
    },3000);
    });
    </script>