Changeset 26


Ignore:
Timestamp:
Dec 27, 2018, 3:47:30 PM (6 years ago)
Author:
chronos
Message:
  • Modified: Improved information parsing from message text.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Import/AstraPraha.php

    r11 r26  
    2929      if ($MeetItem->Gender == 'Hledám partnerku') $MeetItem->Gender = Gender::Male;
    3030        else $MeetItem->Gender = Gender::Female;
    31       $MeetItem->Message = trim(GetTextBetween($Item, '<p class=\'last-element\'>', '</p>'));
     31      $MeetItem->Message = trim(strip_tags(GetTextBetween($Item, '<p class=\'last-element\'>', '</p>')));
    3232      $MeetItem->Email = trim(GetTextBetween($Item, 'class="nowrap text-link">', '</a>'));
    3333      $MeetItem->Name = '';
  • trunk/Import/Csts.php

    r24 r26  
    3434      $MeetItem->Message = trim(html_entity_decode(strip_tags(GetTextBetween($Item, '<td colspan="3">', '</td>'))));
    3535      // Replace unicode non-breakable space by normal space
    36       $MeetItem->Message = str_replace("\xc2\xa0", "\x20", $MeetItem->Message);     
    37       $MeetItem->Age = GetAgeFromText($MeetItem->Message);     
     36      $MeetItem->Message = str_replace("\xc2\xa0", "\x20", $MeetItem->Message);
     37      $MeetItem->Age = GetAgeFromText($MeetItem->Message);
    3838      $MeetItem->Height = GetHeightFromText($MeetItem->Message);
    3939      $MeetItem->Weight = GetWeightFromText($MeetItem->Message);
  • trunk/Meet.php

    r25 r26  
    129129      $Start++;
    130130      $Result = trim(substr($Result, $Start, $Pos - $Start));
    131       break;
     131      if (is_numeric($Result)) break;
    132132    } else break;
    133133  }
     
    165165{
    166166  $Text = strtolower($Text);
    167   $Result = GetNumberBeforeText($Text, 'let');
     167  $Result = GetNumberAfterText($Text, 'je mi');
     168  if ($Result == '') $Result = GetNumberAfterText($Text, 'jsem');
    168169  if ($Result == '') $Result = GetNumberBeforeText($Text, 'rokov');
    169170  if ($Result == '') $Result = GetNumberBeforeText($Text, 'letou');
    170   if ($Result == '') $Result = GetNumberAfterText($Text, 'je mi');
    171   if ($Result == '') $Result = GetNumberAfterText($Text, 'jsem');
     171  if ($Result == '') $Result = GetNumberBeforeText($Text, 'let');
    172172  if ($Result == '') $Result = GetNumberAfterText($Text, 'čerstvých');
    173173  if ($Result == '') $Result = GetAgeHeightWeightFromText($Text)[0];
     
    181181function GetHeightFromText($Text)
    182182{
    183   $Text = strtolower($Text);
    184   $Result = GetNumberBeforeText($Text, 'cm');
    185   if ($Result == '') $Result = GetNumberAfterText($Text, 'měřím');
     183  $Text = strtolower($Text); 
     184  $Result = GetNumberAfterText($Text, 'měřím');
    186185  if ($Result == '') $Result = GetNumberAfterText($Text, 'merim');
     186  if ($Result == '') $Result = GetNumberBeforeText($Text, 'cm'); 
    187187  if ($Result == '') $Result = GetNumberBeforeText($Text, 'bez podpatků');
    188188  if ($Result == '') $Result = GetAgeHeightWeightFromText($Text)[1];
  • trunk/index.php

    r22 r26  
    377377    $this->Database->Prefix = $this->Config['Database']['Prefix'];
    378378    $this->Database->charset($this->Config['Database']['Charset']);
     379    $this->Database->ShowSQLError = false;
     380    $this->Database->ShowSQLQuery = false;
    379381    $this->PathItems = $this->ProcessURL();
    380382
Note: See TracChangeset for help on using the changeset viewer.