Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $linkTySo=$Link;
- $html = file_get_html($linkTySo);
- //table class="match-details match-ellipsis league-table mtn"
- foreach($html->find('table[class="match-details match-ellipsis league-table mtn"]') as $e) {
- $chtml = str_get_html($e->innertext);
- break;
- }
- $i=0;
- foreach($chtml->find('span[class="team"]') as $e) {
- $i++;
- if ($i==1){
- $Doi1 = trim($e->plaintext);
- }
- if ($i==2){
- $Doi2 = trim($e->plaintext);
- break;
- }
- }
- $i=0;
- foreach($chtml->find('tr') as $e) {
- $Phut = "";
- $TySo = "";
- $CauThu1 = "";
- $CauThu2 = "";
- $Bong1 = 0;
- $Bong2 = 0;
- $Vang1 = 0;
- $Vang2 = 0;
- $Do1 = 0;
- $Do2 = 0;
- $VangDo1 = 0;
- $VangDo2 = 0;
- $c2html= str_get_html($e->innertext);
- foreach($c2html->find('td[class="min"]') as $e) {
- $Phut = trim($e->plaintext);
- }
- foreach($c2html->find('td[class="sco"]') as $e) {
- $TySo = trim($e->plaintext);
- }
- foreach($c2html->find('span[class="right name"]') as $e) {
- $CauThu1 = trim($e->plaintext);
- }
- foreach($c2html->find('span[class="left name"]') as $e) {
- $CauThu2 = trim($e->plaintext);
- }
- foreach($c2html->find('span[class="inc goal right"]') as $e) {
- $Bong1=1;
- }
- foreach($c2html->find('span[class="inc goal left"]') as $e) {
- $Bong2=1;
- }
- foreach($c2html->find('span[class="inc yellowcard right"]') as $e) {
- $Vang1=1;
- }
- foreach($c2html->find('span[class="inc yellowcard left"]') as $e) {
- $Vang2=1;
- }
- foreach($c2html->find('span[class="inc redcard right"]') as $e) {
- $Do1=1;
- }
- foreach($c2html->find('span[class="inc redcard left"]') as $e) {
- $Do2=1;
- }
- foreach($c2html->find('span[class="inc redyellowcard right"]') as $e) {
- $VangDo1=1;
- }
- foreach($c2html->find('span[class="inc redyellowcard left"]') as $e) {
- $VangDo2=1;
- }
- //---------------------------//
- if (strlen($Phut)>0){
- $i++;
- /*
- echo "i=$i :: Link: $linkTySo - Doi 1: $Doi1 - Doi2: $Doi2 : ";
- echo "- Phut: " . $Phut;
- echo " - Ty so: " . $TySo;
- echo " - Cauthu1: ". $CauThu1;
- echo " - Cauthu2: ". $CauThu2;
- echo " -> Bong1: ". $Bong1 . "<br>";
- echo " -> Bong2: ". $Bong2 . "<br>";
- echo " -> Vang1: ". $Vang1 . "<br>";
- echo " -> Vang2: ". $Vang2 . "<br>";
- echo " -> Do1: ". $Do1 . "<br>";
- echo " -> Do2: ". $Do2 . "<br>";
- echo " -> VangDo1: ". $VangDo1 . "<br>";
- echo " -> VangDo2: ". $VangDo2 . "<br>";
- */
- $sqlinsert = "INSERT INTO `tivi`.`livescorechitiettrandau` (
- `idTranDau`, `Link`, `Doi1`, `Doi2`, `Phut`, `TySo`, `CauThu1`, `CauThu2`, `Bong1`, `Bong2`, `Vang1`, `Vang2`, `Do1`, `Do2`, `VangDo1`, `VangDo2`)
- VALUES ('$idTranDau','$Link', '$Doi1', '$Doi2', '$Phut', '$TySo', '$CauThu1', '$CauThu2', '$Bong1', '$Bong2', '$Vang1', '$Vang2', '$Do1', '$Do2', '$VangDo1', '$VangDo2');";
- echo $sqlinsert . "<br><br>";
- //mysql_query($sqlinsert);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment