Changeset 18


Ignore:
Timestamp:
Dec 25, 2018, 11:29:38 AM (6 years ago)
Author:
chronos
Message:
  • Modified: Improved parsing of gender for seznamka meet import.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Import/Seznamka.php

    r11 r18  
    2424      $MeetItem = new MeetItem();
    2525      //$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      }
     33      if ($MeetItem->Gender == 'zena') $MeetItem->Gender = Gender::Female;
     34      else if ($MeetItem->Gender == 'muz') $MeetItem->Gender = Gender::Male;
     35      else $MeetItem->Gender = Gender::Undefined;   
    2636      $MeetItem->Name = trim(GetTextBetween($Item, '>', '</span>'));
    2737      $MeetItem->Name = trim(strip_tags($MeetItem->Name));
    28       $MeetItem->Gender = trim(GetTextBetween($Item, ' rel="nofollow">', '</a></span>'));
    29       if ($MeetItem->Gender == 'Tanec / Hledám partnera') $MeetItem->Gender = Gender::Female;
    30       else if ($MeetItem->Gender == 'Tanec / Hledám partnerku') $MeetItem->Gender = Gender::Male;
    31       else $MeetItem->Gender = Gender::Undefined;
     38      $Category = trim(GetTextBetween($Item, ' rel="nofollow">', '</a></span>'));
    3239      $MeetItem->Age = trim(GetTextBetween($Item, ' rel="nofollow">', '</a></span>'));
    3340      $MeetItem->Age = trim(str_replace('let', '', $MeetItem->Age));
  • trunk/Meet.php

    r13 r18  
    189189  {
    190190    $Result = explode('/', $Matches[0][0]);
     191    // Avoid dates in a form day/month/year
     192    if ($Result[2] > 150) $Result = array('', '', '');
    191193  } else
    192194  {
Note: See TracChangeset for help on using the changeset viewer.