puan durumu
5
●3.313
- 02-01-2013, 13:25:55ilk defa bot yazıyorum bu da sana kısmet oldu ona göre

<?php /** * Süper Lig Puan Durumu * @author Gökhan YILDIZ - http://www.gokhan-yildiz.com */ function get($first, $last, $text) { @preg_match_all('/' . preg_quote($first, '/') . '(.*?)'. preg_quote($last, '/').'/i', $text, $m); return @$m[1]; } // Get Content $url = "http://spor.haberturk.com/iddaa/puandurumu/1/turkiye-spor-toto-super-lig"; $content = file_get_contents($url); $get_s = get('class="col1">', '</td>', $content); $get_t = get('class="col2">', '</td>', $content); $get_o = get('class="col3">', '</td>', $content); $get_g = get('class="col4">', '</td>', $content); $get_b = get('class="col5">', '</td>', $content); $get_m = get('class="col6">', '</td>', $content); $get_a = get('class="col7">', '</td>', $content); $get_y = get('class="col8">', '</td>', $content); $get_p = get('class="col9">', '</td>', $content); $get_av = get('class="col10">', '</td>', $content); $get_c = (count($get_s) - 1)/3; //Superlig Puan Durumu echo' <table width="400px" border="1" cellpadding="0" cellspacing="0" style="border:1px dotted #ccc;"> <tr style="background-color:#000; color:#fff; font-weight:bold;"> <td style="width:20px;">Sıra</td> <td style="width:220px;">Takım Adı</td> <td style="width:20px;">O</td> <td style="width:20px;">G</td> <td style="width:20px;">B</td> <td style="width:20px;">M</td> <td style="width:20px;">A</td> <td style="width:20px;">Y</td> <td style="width:20px;">P</td> <td style="width:20px;">AV</td> </tr> '; for ($i=0; $i<=$get_c; $i++) { echo ' <tr> <td><b>'.$get_s[$i].'</b></td> <td>'.strip_tags($get_t[$i]).'</td> <td>'.$get_o[$i].'</td> <td>'.$get_g[$i].'</td> <td>'.$get_b[$i].'</td> <td>'.$get_m[$i].'</td> <td>'.$get_a[$i].'</td> <td>'.$get_y[$i].'</td> <td>'.$get_p[$i].'</td> <td>'.$get_av[$i].'</td> </tr> '; } echo '</table>'; ?>Demo: http://gokhan-yildiz.com/puandurumu.php - 02-01-2013, 16:48:07Buyrun bu da fikstür için.
<?php /** * Süper Lig Fikstür * @author Gökhan YILDIZ - http://www.gokhan-yildiz.com */ function get($first, $last, $text) { @preg_match_all('/' . preg_quote($first, '/') . '(.*?)'. preg_quote($last, '/').'/i', $text, $m); return @$m[1]; } $status =strip_tags(htmlspecialchars(trim($_GET["week"]))); // Get Content if($status=="this"){ $url = "http://skorer.milliyet.com.tr/Fikstur?TTName=";} elseif($status=="next") { $url = "http://skorer.milliyet.com.tr/Fikstur?TTName=&RW=1";} elseif($status=="last") { $url = "http://skorer.milliyet.com.tr/Fikstur?TTName=&RW=-1";} elseif($status==""){ $url = "http://skorer.milliyet.com.tr/Fikstur?TTName="; } $content = file_get_contents($url); $get_date = get('class="date">', '</td>', $content); $get_hour = get('class="hour">', '</td>', $content); $get_team1 = get('class="team team1">', '</td>', $content); $get_score = get('class="sonuc">', '</td>', $content); $get_team2 = get('class="team team2">', '</td>', $content); $get_count = count($get_date) - 1; //Superlig Puan Durumu echo ' <a href="fixture.php?week=last">Geçen Hafta</a> | <a href="fixture.php?week=this">Bu Hafta</a> | <a href="fixture.php?week=next">Gelecek Hafta</a> '; if($status=="this"){echo "<h4>Süper Lig'de Bu Hafta</h4>";} elseif($status=="next"){echo "<h4>Süper Lig'de Gelecek Hafta</h4>";} elseif($status=="last"){echo "<h4>Süper Lig'de Geçen Hafta</h4>";} elseif($status==""){echo "<h4>Süper Lig'de Bu Hafta</h4>";} echo' <table width="560px" border="1" cellpadding="0" cellspacing="0" style="border:1px dotted #ccc;"> <tr style="background-color:#000; color:#fff; font-weight:bold;"> <td style="width:120px;">Tarih</td> <td style="width:50px;">Saat</td> <td style="width:220px;">Ev Sahibi</td> <td style="width:50px;">Skor</td> <td style="width:220px;">Misafir Takım</td> </tr> '; for ($i=0; $i<=$get_count; $i++) { echo ' <tr> <td>'.$get_date[$i].'</td> <td>'.$get_hour[$i].'</td> <td>'.$get_team1[$i].'</td> <td>'.strip_tags($get_score[$i]).'</td> <td>'.$get_team2[$i].'</td> </tr> '; } echo '</table>'; ?>Demo: http://gokhan-yildiz.com/fixture.php - 05-03-2013, 15:14:18süpersiniz , türkçe karakter sorunu yaşadım ben örneğin Ankaragücü şeklinde çıkıyor , önerisi olan varmıdır?
düzeltme: utf8 olarak düzeltince sorunda düzeldi,ama bu seferde süper toto 1nci ligi çekmek için hangi kodu değiştirmem gerekiyor, puan durumunu çektim ama fiksturu beceremedim
düzeltme 2: linki düzeltince , oldu
http://www.ergezer.com/ptt-1-lig-fikstur.php
http://www.ergezer.com/ptt-1-lig-puan-durumu.php
