Changeset 11 for trunk/Meet.php


Ignore:
Timestamp:
Aug 26, 2018, 8:53:55 PM (6 years ago)
Author:
chronos
Message:
  • Fixed: Updated parsing of Astra website.
  • Fixed: Correctly parse Amblar date.
  • Added: Allow to update only one meet source by specified id.
  • Added: Show RSS link with RSS icon under meet table.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Meet.php

    r10 r11  
    145145
    146146      $Result = trim(substr($Result, 0, $End + 1));
    147       break;
     147      if (is_numeric($Result)) break;
    148148    } else break;
    149149  }
     
    153153function GetAgeFromText($Text)
    154154{
     155  $Text = strtolower($Text);
    155156  $Result = GetNumberBeforeText($Text, 'let');
    156   if ($Result == '') $Result = GetNumberAfterText($Text, 'Je mi');
     157  if ($Result == '') $Result = GetNumberAfterText($Text, 'je mi');
     158  if ($Result == '') $Result = GetNumberAfterText($Text, 'jsem');
    157159  if ($Result == '') $Result = GetNumberAfterText($Text, 'čerstvých');
    158160  if ($Result == '') $Result = GetAgeHeightWeightFromText($Text)[0];
     
    162164function GetHeightFromText($Text)
    163165{
     166  $Text = strtolower($Text);
    164167  $Result = GetNumberBeforeText($Text, 'cm');
    165168  if ($Result == '') $Result = GetNumberAfterText($Text, 'měřím');
     169  if ($Result == '') $Result = GetNumberAfterText($Text, 'merim');
    166170  if ($Result == '') $Result = GetNumberBeforeText($Text, 'bez podpatků');
    167171  if ($Result == '') $Result = GetAgeHeightWeightFromText($Text)[1];
     
    171175function GetWeightFromText($Text)
    172176{
     177  $Text = strtolower($Text);
    173178  $Result = GetNumberBeforeText($Text, 'kg');
    174179  if ($Result == '') $Result = GetAgeHeightWeightFromText($Text)[2];
     
    233238  public $Database;
    234239
    235   function ParseAll()
    236   {
    237     $DbResult = $this->Database->select('MeetSource', '*');
     240  function Parse($Id = null)
     241  {
     242    if (($Id != null) and is_numeric($Id)) $Where = 'Id='.$Id;
     243      else $Where = '1';
     244    $DbResult = $this->Database->select('MeetSource', '*', $Where);
    238245    while ($DbRow = $DbResult->fetch_assoc())
    239246    {
     
    267274  public $Id;
    268275  public $Database;
     276
     277  function Import()
     278  {
     279    $this->AddedCount = 0;
     280    echo('Parsing '.$this->Name.' ('.$this->Id.')...</br>');
     281  }
    269282}
    270283
     
    310323        'Link' => $this->Link,
    311324      ));
    312     }
    313   }
    314 }
     325      $Result = 1;
     326    } else $Result = 0;
     327    return($Result);
     328  }
     329}
Note: See TracChangeset for help on using the changeset viewer.