Döviz Verilerini Bot ile Çekmek ve Json Olarak Oluşturmak
index-json-cikti.php dosyasında Doviz.com'da bulunan verileri çekip sunucuda doviz.json dosyası olarak dosya oluşturmasını sağlayabilirsiniz. Sunucuda cron ayarı yaparak belli aralıklarla dosyanın çalıştırılmasını sağlarsanız kurun güncellenme süresini siz belirlemiş olursunuz.
Aşağıdaki kod yapısı ile dilediğiniz veriyi oluşturduğunuz doviz.json dosyasından çekebilirsiniz.
$jsonVeri=file_get_contents("doviz.json");
$veri=json_decode($jsonVeri,1);
echo $veri["doviz"]["DOLAR ALIS"];
echo $veri["doviz"]["DOLAR SATIS"];