Konu sahibinin izni olursa kendi yazdığım aynı api ile coin fiyatlarını da eklemek isterim
demo :
https://sarkisozlerix.net/kadirkc/koin.php <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/kube/6.5.2/css/kube.min.css"/>
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, 'https://api.coinmarketcap.com/v2/ticker/?convert=TRY&limit=10');
$s = curl_exec($ch);
curl_close($ch);
$data = json_decode($s, true);
echo "<table class='unstyled striped'><tr><td colspan='3'>Koin</td></tr>";
foreach($data[data] as $da){
echo "<tr><td><img width='24px' height='24px' src='https://raw.githubusercontent.com/cjdowner/cryptocurrency-icons/master/32/color/" . strtolower($da[symbol]) . ".png' alt='" . $da[website_slug] . "'/>" . $da[name];
if($da[quotes]['TRY'][percent_change_24h] < 0) echo "<i class='arrow-down'></i>"; else echo "<i class='arrow-up'></i>";
echo "</td><td>" . number_format($da[quotes]['TRY'][price], 2, ',', '.') . "₺</td>" . "<td>";
if($da[quotes]['TRY'][percent_change_24h] < 0) echo "<font color='red'>" . $da[quotes]['TRY'][percent_change_24h] . "</font>";
else echo "<font color='green'>" . $da[quotes]['TRY'][percent_change_24h] . "</font>";
echo "</td></tr>";
}
echo "</table>";
?>
<style type="text/css">
.arrow-up{
width: 0;
height: 0;
content: "";
float: right;
margin: 5px 2px 0;
vertical-align: top;
display: inline-block;
border-bottom: 10px solid #26a17b;
border-right: 8px solid transparent;
border-left: 8px solid transparent;
}
.arrow-down{
width: 0;
height: 0;
content: "";
float: right;
margin: 6px 2px 0;
vertical-align: top;
display: inline-block;
border-top: 10px solid #CC2b1b;
border-right: 8px solid transparent;
border-left: 8px solid transparent;
}
.unstyled{
margin: auto;
max-width: 500px;
background: #eee;
border: none !important;
border-top: 3px solid #26a17b !important;
/* box-shadow: 0 5px 15px rgba(39,40,44,.15); */
}
.unstyled tr:first-child{
line-height: 30px;
}
.unstyled img{
margin-right: 7px;
vertical-align: top;
display: inline-block;
}
.unstyled td{
padding: 7px 10px !important;
}
</style>