ProfessorTR adlı üyeden alıntı: mesajı görüntüle
Arkadaşlar merhaba ,
Koha(.) net sitesinde biraz alt kısımda şöyle bir bileşen var. Bulma şansımız ve wordpress e uygulama şansımız var mıdır?
Ücretsiz api var zaten https://documenter.getpostman.com/vi...08728/SzS8rjbc burayı incele
Misal türkiye için basit bir örnek yapayım sen türet.
Türkiye için örnek kullanım;
<?php
    $from = '2020-10-01T00:00:00Z';
    $to = '2020-10-08T00:00:00Z';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.covid19api.com/country/turkey?from='.$from.'&to='.$to);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$data = curl_exec($ch);
if ($data === false) :
$result = curl_error($ch);
else :
$result = json_decode($data,FALSE);
endif;
curl_close($ch);
    
     print '<h1>Tarihe Göre Toplam Ölü Sayıları</h1>';
     print '<ul>';
    
     foreach($result as $ok) :
            print '<li>Tarih: ' . $ok->Date . ' Toplam Ölü Sayısı - ' . $ok->Deaths . '</li>';
     endforeach;
    
     print '</ul>';
    
     print '<h3>URL: https://api.covid19api.com/country/turkey?from=' . $from. '&to=' . $to . '</h3>';
     print '<h5>XAWeb</h5>';
?>