Changeset 18 for trunk/Import


Ignore:
Timestamp:
Dec 25, 2018, 11:29:38 AM (6 years ago)
Author:
chronos
Message:
  • Modified: Improved parsing of gender for seznamka meet import.
File:
1 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));
Note: See TracChangeset for help on using the changeset viewer.