Changeset 37 for trunk/Modules/Meet/Import
- Timestamp:
- May 5, 2019, 5:17:06 PM (6 years ago)
- Location:
- trunk/Modules
- Files:
-
- 2 added
- 10 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Meet/Import/Amblar.php
r32 r37 28 28 function Import() 29 29 { 30 parent::Import();30 $Output = parent::Import(); 31 31 $Content = file_get_contents($this->URL); 32 32 … … 37 37 if ($Content == '') 38 38 { 39 echo('Main block not isolated.</br>');40 return ;39 $Output .= 'Main block not isolated.</br>'; 40 return $Output; 41 41 } 42 42 … … 72 72 $MeetItem->Database = $this->Database; 73 73 $MeetItem->Source = $this->Id; 74 $ this->ImportItem($MeetItem);74 $Output .= $this->ImportItem($MeetItem); 75 75 $this->AddedCount += $MeetItem->AddIfNotExist(); 76 76 } 77 return $Output; 77 78 } 78 79 … … 81 82 global $HeightTags, $AgeTags, $LevelTags; 82 83 84 $Output = ''; 83 85 $Content = file_get_contents($MeetItem->Link); 84 86 … … 88 90 if ($Content == '') 89 91 { 90 echo('Main block not isolated.</br>');92 $Output .= 'Main block not isolated.</br>'; 91 93 return; 92 94 } … … 106 108 if ($Tag == 'Praha') $MeetItem->Location = 'Praha'; 107 109 } 110 return $Output; 108 111 } 109 112 } -
trunk/Modules/Meet/Import/AstraPraha.php
r32 r37 5 5 function Import() 6 6 { 7 parent::Import();7 $Output = parent::Import(); 8 8 $Content = file_get_contents($this->URL); 9 9 … … 13 13 if ($Content == '') 14 14 { 15 echo('Main block not isolated.</br>');16 return ;15 $Output .= 'Main block not isolated.</br>'; 16 return $Output; 17 17 } 18 18 … … 41 41 $this->AddedCount += $MeetItem->AddIfNotExist(); 42 42 } 43 return $Output; 43 44 } 44 45 } -
trunk/Modules/Meet/Import/Csts.php
r31 r37 5 5 function Import() 6 6 { 7 parent::Import();7 $Output = parent::Import(); 8 8 $Content = file_get_contents($this->URL); 9 9 … … 13 13 if ($Content == '') 14 14 { 15 echo('Main block not isolated.</br>');16 return ;15 $Output .= 'Main block not isolated.</br>'; 16 return $Output; 17 17 } 18 18 … … 47 47 $this->AddedCount += $MeetItem->AddIfNotExist(); 48 48 } 49 return $Output; 49 50 } 50 51 } -
trunk/Modules/Meet/Import/Eso.php
r32 r37 5 5 function Import() 6 6 { 7 parent::Import();7 $Output = parent::Import(); 8 8 $Content = file_get_contents($this->URL); 9 9 … … 13 13 if ($Content == '') 14 14 { 15 echo('Main block not isolated.</br>');16 return ;15 $Output .= 'Main block not isolated.</br>'; 16 return $Output; 17 17 } 18 18 … … 51 51 $this->AddedCount += $MeetItem->AddIfNotExist(); 52 52 } 53 return $Output; 53 54 } 54 55 } -
trunk/Modules/Meet/Import/Facebook.php
r31 r37 6 6 { 7 7 return; 8 parent::Import();8 $Output = parent::Import(); 9 9 $Content = file_get_contents($this->URL); 10 10 echo($Content); … … 15 15 if ($Content == '') 16 16 { 17 echo('Main block not isolated.</br>');18 return ;17 $Output .= 'Main block not isolated.</br>'; 18 return $Output; 19 19 } 20 20 … … 50 50 $this->AddedCount += $MeetItem->AddIfNotExist(); 51 51 } 52 return $Output; 52 53 } 53 54 } -
trunk/Modules/Meet/Import/MajkluvSvet.php
r31 r37 5 5 function Import() 6 6 { 7 parent::Import();7 $Output = parent::Import(); 8 8 $Content = file_get_contents($this->URL); 9 9 … … 13 13 if ($Content == '') 14 14 { 15 echo('Main block not isolated.</br>');16 return ;15 $Output .= 'Main block not isolated.</br>'; 16 return $Output; 17 17 } 18 18 … … 29 29 $MeetItem->Name = trim(GetTextBetween($Item, "<span class='seznamka_nadpis'><b>", '</b>')); 30 30 $MeetItem->Height = trim(GetTextBetween($Item, "výška:", 'cm')); 31 $MeetItem->Age = trim(GetTextBetween($Item, "věk:", 'let'));31 $MeetItem->Age = preg_replace("/[^0-9]/", "", trim(GetTextBetween($Item, "věk:", 'let'))); 32 32 $MeetItem->Message = trim(GetTextBetween($Item, "display:block;text-align:justify;'>", '</span>')); 33 33 $MeetItem->Weight = GetWeightFromText($MeetItem->Message); … … 50 50 $this->AddedCount += $MeetItem->AddIfNotExist(); 51 51 } 52 return $Output; 52 53 } 53 54 } -
trunk/Modules/Meet/Import/SalsaDance.php
r31 r37 5 5 function Import() 6 6 { 7 parent::Import();7 $Output = parent::Import(); 8 8 $Content = file_get_contents($this->URL); 9 9 $BlockStart = '<ul class="comments">'; … … 12 12 if ($Content == '') 13 13 { 14 echo('Main block not isolated.</br>');15 return ;14 $Output .= 'Main block not isolated.</br>'; 15 return $Output; 16 16 } 17 17 … … 42 42 $this->AddedCount += $MeetItem->AddIfNotExist(); 43 43 } 44 return $Output; 44 45 } 45 46 } -
trunk/Modules/Meet/Import/Seznamka.php
r32 r37 5 5 function Import() 6 6 { 7 parent::Import();7 $Output = parent::Import(); 8 8 $Content = file_get_contents($this->URL); 9 $BlockStart = ' Tanec ...</h1 class=\'nadpis\'>';10 $BlockEnd = '< !--';9 $BlockStart = '<h1>Tanec ... : Seznamka</h1>'; 10 $BlockEnd = '<h2>Doporučujeme</h2>'; 11 11 //echo($Content); 12 12 $Content = GetTextBetween($Content, $BlockStart, $BlockEnd); 13 13 if ($Content == '') 14 14 { 15 echo('Main block not isolated.</br>');16 return ;15 $Output .= 'Main block not isolated.</br>'; 16 return $Output; 17 17 } 18 18 19 $ItemStart = '<div class=\' inztop\'>';19 $ItemStart = '<div class=\'col-xs-12\'>'; 20 20 $ItemEnd = 'Odpovědět</a></div></div></div>'; 21 21 while (strpos($Content, $ItemStart) !== false) 22 22 { 23 23 $Item = GetTextBetween($Content, $ItemStart, $ItemEnd); 24 if ($Item == '') break; 24 25 $MeetItem = new MeetItem(); 25 26 //$MeetItem->Image = trim(GetTextBetween($Item, '<div', '</div>')); 26 if (strpos($Item, "return false\" class='") !== false) 27 { 28 $MeetItem->Gender = trim(GetTextBetween($Item, "return false\" class='", "'")); 29 } else 30 { 31 $MeetItem->Gender = trim(GetTextBetween($Item, '<span class="ipoh ', '"')); 32 } 27 $MeetItem->Gender = trim(GetTextBetween($Item, "<span class=\"ipoh ", "\"")); 33 28 if ($MeetItem->Gender == 'zena') $MeetItem->Gender = Gender::Female; 34 else if ($MeetItem->Gender == 'muz') $MeetItem->Gender = Gender::Male;35 else $MeetItem->Gender = Gender::Undefined;29 else if ($MeetItem->Gender == 'muz') $MeetItem->Gender = Gender::Male; 30 else $MeetItem->Gender = Gender::Undefined; 36 31 $MeetItem->Name = trim(GetTextBetween($Item, '>', '</span>')); 37 32 $MeetItem->Name = trim(strip_tags($MeetItem->Name)); 38 $Category = trim(GetTextBetween($Item, ' rel="nofollow">', '</a></span>'));39 $MeetItem->Age = trim(GetTextBetween($Item, ' rel="nofollow">', '</a></span>'));33 $Category = trim(GetTextBetween($Item, '" >', '</a>')); 34 $MeetItem->Age = trim(GetTextBetween($Item, '" >', '</a>')); 40 35 $MeetItem->Age = trim(str_replace('let', '', $MeetItem->Age)); 41 $MeetItem->Location = trim(GetTextBetween($Item, ' rel="nofollow">', '</a></span>')); 42 $MeetItem->Time = HumanDateToTime(trim(GetTextBetween($Item, '> </a>', '</span>'))); 43 $MeetItem->Message = trim(strip_tags(GetTextBetween($Item, 'margin-top:10px;\'>', '</div>'))); 36 $MeetItem->Location = trim(GetTextBetween($Item, '" >', '</a>')); 37 $MeetItem->Time = trim(GetTextBetween($Item, 'TOP</a> ', '</span>')); 38 if ($MeetItem->Time == 'Včera') $MeetItem->Time = HumanDate(time() - 60*60*24); 39 else if ($MeetItem->Time == 'Dnes') $MeetItem->Time = HumanDate(time()); 40 $MeetItem->Time = HumanDateToTime($MeetItem->Time); 41 $MeetItem->Message = trim(strip_tags(GetTextBetween($Item, '<p>', '</p>'))); 44 42 $MeetItem->Link = GetTextBetween($Item, "<a href='", "'"); 45 43 while (substr($MeetItem->Link, 0, 3) == '../') … … 54 52 $this->AddedCount += $MeetItem->AddIfNotExist(); 55 53 } 54 return $Output; 56 55 } 57 56 } -
trunk/Modules/Meet/Import/TanecniSkola.php
r32 r37 5 5 function Import() 6 6 { 7 $Output = ''; 7 8 $HeightRange = array( 8 9 '< 120 cm' => 120, … … 26 27 ); 27 28 28 parent::Import();29 $Output = parent::Import(); 29 30 $Content = file_get_contents($this->URL); 30 31 … … 34 35 if ($Content == '') 35 36 { 36 echo('Main block not isolated.</br>');37 return ;37 $Output .= 'Main block not isolated.</br>'; 38 return $Output; 38 39 } 39 40 … … 94 95 } 95 96 } 97 return $Output; 96 98 } 97 99 } -
trunk/Modules/Meet/Import/Vavruska.php
r31 r37 5 5 function Import() 6 6 { 7 parent::Import();7 $Output = parent::Import(); 8 8 $Content = file_get_contents($this->URL); 9 9 … … 13 13 if ($Content == '') 14 14 { 15 echo('Main block not isolated.</br>');16 return ;15 $Output .= 'Main block not isolated.</br>'; 16 return $Output; 17 17 } 18 18 … … 41 41 $this->AddedCount += $MeetItem->AddIfNotExist(); 42 42 } 43 return $Output; 43 44 } 44 45 }
Note:
See TracChangeset
for help on using the changeset viewer.