<?php
header("Content-Type: text/html; charset=utf-8");
function verial($url)
{if (!extension_loaded(curl))
{
die("Extension yuklu degil socket deneyebilirsin");
}
$ch = curl_init();
if (!$ch) { die ("Curl oturumu baslatamadim.."); }
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$site=verial("http://www.namazvakti.com/Main.php?cityID=16770"); // Alinacak Siteyi Belirliyoruz.
preg_match_all('#<table cellpadding="0" cellspacing="0" border="0" width="95%">(.*?)</table>#si',$site,$bilgi,PREG_SET_ORDER);
preg_match_all('#<td id="textImsak" class="pText">(.*?)</td>#si',$bilgi[0][0],$FollowME1,PREG_SET_ORDER);
$FollowME1=$FollowME1[0][1];
preg_match_all('#<td id="timeImsak" class="pTime">(.*?)</td>#si',$bilgi[0][0],$FollowME1s,PREG_SET_ORDER);
$FollowME1s=$FollowME1s[0][1];
preg_match_all('#<td id="textGunes" class="pText">(.*?)</td>#si',$bilgi[0][0],$FollowME2,PREG_SET_ORDER);
$FollowME2=$FollowME2[0][1];
preg_match_all('#<td id="timeGunes" class="pTime">(.*?)</td>#si',$bilgi[0][0],$FollowME2s,PREG_SET_ORDER);
$FollowME2s=$FollowME2s[0][1];
preg_match_all('#<td id="textOgle" class="pText">(.*?)</td>#si',$bilgi[0][0],$FollowME3,PREG_SET_ORDER);
$FollowME3=$FollowME3[0][1];
preg_match_all('#<td id="timeOgle" class="pTime">(.*?)</td>#si',$bilgi[0][0],$FollowME3s,PREG_SET_ORDER);
$FollowME3s=$FollowME3s[0][1];
preg_match_all('#<td id="textIkindi" class="pText">(.*?)</td>#si',$bilgi[0][0],$FollowME4,PREG_SET_ORDER);
$FollowME4=$FollowME4[0][1];
preg_match_all('#<td id="timeIkindi" class="pTime">(.*?)</td>#si',$bilgi[0][0],$FollowME4s,PREG_SET_ORDER);
$FollowME4s=$FollowME4s[0][1];
preg_match_all('#<td id="textAksam" class="pText">(.*?)</td>#si',$bilgi[0][0],$FollowME5,PREG_SET_ORDER);
$FollowME5=$FollowME5[0][1];
preg_match_all('#<td id="timeAksam" class="pTime">(.*?)</td>#si',$bilgi[0][0],$FollowME5s,PREG_SET_ORDER);
$FollowME5s=$FollowME5s[0][1];
preg_match_all('#<td id="textYatsi" class="pText">(.*?)</td>#si',$bilgi[0][0],$FollowME6,PREG_SET_ORDER);
$FollowME6=$FollowME6[0][1];
preg_match_all('#<td id="timeYatsi" class="pTime">(.*?)</td>#si',$bilgi[0][0],$FollowME6s,PREG_SET_ORDER);
$FollowME6s=$FollowME6s[0][1];
?>
<?=$FollowME1?>
<?=$FollowME2?>
<?=$FollowME3?>
<?=$FollowME4?>
<?=$FollowME5?>
<?=$FollowME6?>
<?=$FollowME1s?>
<?=$FollowME2s?>
<?=$FollowME3s?>
<?=$FollowME4s?>
<?=$FollowME5s?>
<?=$FollowME6s?>merhabalar bu sekilde karsı siteden verileri fakat tek ilin verilerini cekiyorum bütün illerin verilerini cekebilmem için ne yapmam gerekiyor bir bakarmısınız lütfen
Namaz Vakitleri Botu Bir Bakarmısınız
9
●2.233
- 01-01-2013, 23:02:20Üyeliği durduruldu
- 02-01-2013, 15:15:53$site=verial("http://www.namazvakti.com/Main.php?cityID=16770"); // Alinacak Siteyi Belirliyoruz.
Bu satırda bulunan cityID şehir ID numarasıdır.
İki tane iç içe döngü kurmanız gerek.
<BİRİNCİ DÖNGÜ>
{
$site=verial("http://www.namazvakti.com/Main.php?cityID=$OTOMATIK_ARTAN_SEHIR_ID_DEGISKENI ");
<İKİNCİ DÖNGÜ>
{
Aşağıda kalan kodların tümü buraya
}
</İKİNCİ DÖNGÜ>
}
</BİRİNCİ DÖNGÜ> - 02-01-2013, 16:24:03Üyeliği durdurulduarkadaşlar bir türlü yapamadım yeniyim php de for döngüsüne sokamadım şu linki koda uygularsanız lütfen sizden ricamPsdBul adlı üyeden alıntı: mesajı görüntüle
- 02-01-2013, 16:49:14Üyeliği durdurulduhocam bi çaresi yokmu bu işinPsdBul adlı üyeden alıntı: mesajı görüntüle
- 02-01-2013, 17:06:19size yardımcı olmak için dediğim tarzda sırayla veren bir site aradım ama bulamadımwebstorm adlı üyeden alıntı: mesajı görüntüle
- 02-01-2013, 18:53:49Üyeliği durdurulduhttp://www.namazvaktim.net/adana/PsdBul adlı üyeden alıntı: mesajı görüntüle
hocam sanırım burada sıralı vermis bi yardımcı olursanız buradan cekelim - 03-01-2013, 00:41:33
function site_kaynak($url) { if (function_exists('curl_init')) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1"); return curl_exec($ch); } } $ss = site_kaynak("https://ezanvakti.herokuapp.com/vakitler/9392"); $coz = json_decode($ss,true); print_r($coz);EDİT : 15.12.2020
** https://ezanvakti.herokuapp.com/sehirler/2 bu urlden şehir id değeri alınır,
** https://ezanvakti.herokuapp.com/ilceler/524 bu urlden ilçe id değeri alınır,
** https://ezanvakti.herokuapp.com/vakitler/9392 bu json dosyası curl ile getirilir ( Yukarıdaki örnek bu urlye istek gönderiyor )
Gelen json dosyası array olarka işlenip istediğiniz yerde kullanabilirsiniz. Sitenin apisini aylık olarak 1 kere yüklemeniz yeterli olur.