Changeset 20 for trunk/Import


Ignore:
Timestamp:
Dec 26, 2018, 11:55:16 AM (6 years ago)
Author:
chronos
Message:
  • Added: Meet list filtering by name, location and message text.
  • Fixed: Amblar meet source date parsing.
Location:
trunk/Import
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Import/Amblar.php

    r17 r20  
    5353        else $MeetItem->Gender = Gender::Male;
    5454      $MeetItem->Name = trim(GetTextBetween($Item, '<span class="dwqa-author">', '</span>'));
     55      $Type = trim(GetTextBetween($Item, ' ', ' '));
     56      if ($Type == 'odpovězeno') continue;
    5557      $MeetItem->Date = trim(GetTextBetween($Item, '<span class="dwqa-date">', '</span>'));
    56       if ($MeetItem->Date == 'před 1 dní') $MeetItem->Date = strtotime("-1 days");
    57         else if ($MeetItem->Date == 'před 2 dny') $MeetItem->Date = strtotime("-2 days");
    58         else $MeetItem->Date = HumanDateToTime($MeetItem->Date);
     58      if (mb_substr($MeetItem->Date, 0, 4) == 'před')
     59      {           
     60        $Parts = explode(' ', $MeetItem->Date);
     61        if ($Parts[2] == 'hours') $MeetItem->Date = strtotime("-".$Parts[1]." hours");
     62        else if ($Parts[2] == 'dní') $MeetItem->Date = strtotime("-".$Parts[1]." days");
     63        else if ($Parts[2] == 'dny') $MeetItem->Date = strtotime("-".$Parts[1]." days");
     64      } else $MeetItem->Date = HumanDateToTime($MeetItem->Date);
    5965      $MeetItem->Email = '';
    6066      $MeetItem->Message = '';
  • trunk/Import/Csts.php

    r19 r20  
    4141      if ($MeetItem->Phone == 'neuveden') $MeetItem->Phone = '';
    4242      $MeetItem->Link = '';
    43       print_r($MeetItem);
    4443      $MeetItem->Database = $this->Database;
    4544      $MeetItem->Source = $this->Id;
Note: See TracChangeset for help on using the changeset viewer.