Ignore:
Timestamp:
May 5, 2019, 5:17:06 PM (6 years ago)
Author:
chronos
Message:
  • Modified: Application made using classes System and Application.
  • Modified: Used Common package for better code reuse.
  • Modified: Application made modular. Web sections converted to application modules. They will register pages in main application object.
Location:
trunk/Modules
Files:
2 added
10 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Meet/Import/Amblar.php

    r32 r37  
    2828  function Import()
    2929  {
    30     parent::Import();
     30    $Output = parent::Import();
    3131    $Content = file_get_contents($this->URL);
    3232
     
    3737    if ($Content == '')
    3838    {
    39       echo('Main block not isolated.</br>');
    40       return;
     39      $Output .= 'Main block not isolated.</br>';
     40      return $Output;
    4141    }
    4242
     
    7272      $MeetItem->Database = $this->Database;
    7373      $MeetItem->Source = $this->Id;
    74       $this->ImportItem($MeetItem);
     74      $Output .= $this->ImportItem($MeetItem);
    7575      $this->AddedCount += $MeetItem->AddIfNotExist();
    7676    }
     77    return $Output;
    7778  }
    7879
     
    8182    global $HeightTags, $AgeTags, $LevelTags;
    8283
     84    $Output = '';
    8385    $Content = file_get_contents($MeetItem->Link);
    8486
     
    8890    if ($Content == '')
    8991    {
    90       echo('Main block not isolated.</br>');
     92      $Output .= 'Main block not isolated.</br>';
    9193      return;
    9294    }
     
    106108      if ($Tag == 'Praha') $MeetItem->Location = 'Praha';
    107109    }
     110    return $Output;
    108111  }
    109112}
  • trunk/Modules/Meet/Import/AstraPraha.php

    r32 r37  
    55  function Import()
    66  {
    7     parent::Import();
     7    $Output = parent::Import();
    88    $Content = file_get_contents($this->URL);
    99
     
    1313    if ($Content == '')
    1414    {
    15       echo('Main block not isolated.</br>');
    16       return;
     15      $Output .= 'Main block not isolated.</br>';
     16      return $Output;
    1717    }
    1818
     
    4141      $this->AddedCount += $MeetItem->AddIfNotExist();
    4242    }
     43    return $Output;
    4344  }
    4445}
  • trunk/Modules/Meet/Import/Csts.php

    r31 r37  
    55  function Import()
    66  {
    7     parent::Import();
     7    $Output = parent::Import();
    88    $Content = file_get_contents($this->URL);
    99
     
    1313    if ($Content == '')
    1414    {
    15       echo('Main block not isolated.</br>');
    16       return;
     15      $Output .= 'Main block not isolated.</br>';
     16      return $Output;
    1717    }
    1818
     
    4747      $this->AddedCount += $MeetItem->AddIfNotExist();
    4848    }
     49    return $Output;
    4950  }
    5051}
  • trunk/Modules/Meet/Import/Eso.php

    r32 r37  
    55  function Import()
    66  {
    7     parent::Import();
     7    $Output = parent::Import();
    88    $Content = file_get_contents($this->URL);
    99
     
    1313    if ($Content == '')
    1414    {
    15       echo('Main block not isolated.</br>');
    16       return;
     15      $Output .= 'Main block not isolated.</br>';
     16      return $Output;
    1717    }
    1818
     
    5151      $this->AddedCount += $MeetItem->AddIfNotExist();
    5252    }
     53    return $Output;
    5354  }
    5455}
  • trunk/Modules/Meet/Import/Facebook.php

    r31 r37  
    66  {
    77    return;   
    8     parent::Import();
     8    $Output = parent::Import();
    99    $Content = file_get_contents($this->URL);
    1010    echo($Content);
     
    1515    if ($Content == '')
    1616    {
    17       echo('Main block not isolated.</br>');
    18       return;
     17      $Output .= 'Main block not isolated.</br>';
     18      return $Output;
    1919    }
    2020
     
    5050      $this->AddedCount += $MeetItem->AddIfNotExist();
    5151    }
     52    return $Output;
    5253  }
    5354}
  • trunk/Modules/Meet/Import/MajkluvSvet.php

    r31 r37  
    55  function Import()
    66  {
    7     parent::Import();
     7    $Output = parent::Import();
    88    $Content = file_get_contents($this->URL);
    99
     
    1313    if ($Content == '')
    1414    {
    15       echo('Main block not isolated.</br>');
    16       return;
     15      $Output .= 'Main block not isolated.</br>';
     16      return $Output;
    1717    }
    1818
     
    2929      $MeetItem->Name = trim(GetTextBetween($Item, "<span class='seznamka_nadpis'><b>", '</b>'));
    3030      $MeetItem->Height = trim(GetTextBetween($Item, "výška:", 'cm'));
    31       $MeetItem->Age = trim(GetTextBetween($Item, "věk:", 'let'));
     31      $MeetItem->Age = preg_replace("/[^0-9]/", "", trim(GetTextBetween($Item, "věk:", 'let')));
    3232      $MeetItem->Message = trim(GetTextBetween($Item, "display:block;text-align:justify;'>", '</span>'));
    3333      $MeetItem->Weight = GetWeightFromText($MeetItem->Message);
     
    5050      $this->AddedCount += $MeetItem->AddIfNotExist();
    5151    }
     52    return $Output;
    5253  }
    5354}
  • trunk/Modules/Meet/Import/SalsaDance.php

    r31 r37  
    55  function Import()
    66  {
    7     parent::Import();
     7    $Output = parent::Import();
    88    $Content = file_get_contents($this->URL);
    99    $BlockStart = '<ul class="comments">';
     
    1212    if ($Content == '')
    1313    {
    14       echo('Main block not isolated.</br>');
    15       return;
     14      $Output .= 'Main block not isolated.</br>';
     15      return $Output;
    1616    }
    1717
     
    4242      $this->AddedCount += $MeetItem->AddIfNotExist();
    4343    }
     44    return $Output;
    4445  }
    4546}
  • trunk/Modules/Meet/Import/Seznamka.php

    r32 r37  
    55  function Import()
    66  {
    7     parent::Import();
     7    $Output = parent::Import();
    88    $Content = file_get_contents($this->URL);
    9     $BlockStart = 'Tanec ...</h1 class=\'nadpis\'>';
    10     $BlockEnd = '<!--';
     9    $BlockStart = '<h1>Tanec ... : Seznamka</h1>';
     10    $BlockEnd = '<h2>Doporučujeme</h2>';
    1111    //echo($Content);
    1212    $Content = GetTextBetween($Content, $BlockStart, $BlockEnd);
    1313    if ($Content == '')
    1414    {
    15       echo('Main block not isolated.</br>');
    16       return;
     15      $Output .= 'Main block not isolated.</br>';
     16      return $Output;
    1717    }
    1818
    19     $ItemStart = '<div class=\'inztop\'>';
     19    $ItemStart = '<div class=\'col-xs-12\'>';
    2020    $ItemEnd = 'Odpovědět</a></div></div></div>';
    2121    while (strpos($Content, $ItemStart) !== false)
    2222    {
    2323      $Item = GetTextBetween($Content, $ItemStart, $ItemEnd);
     24      if ($Item == '') break;
    2425      $MeetItem = new MeetItem();
    2526      //$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       }
     27      $MeetItem->Gender = trim(GetTextBetween($Item, "<span class=\"ipoh ", "\""));
    3328      if ($MeetItem->Gender == 'zena') $MeetItem->Gender = Gender::Female;
    34       else if ($MeetItem->Gender == 'muz') $MeetItem->Gender = Gender::Male;
    35       else $MeetItem->Gender = Gender::Undefined;   
     29        else if ($MeetItem->Gender == 'muz') $MeetItem->Gender = Gender::Male;
     30        else $MeetItem->Gender = Gender::Undefined;   
    3631      $MeetItem->Name = trim(GetTextBetween($Item, '>', '</span>'));
    3732      $MeetItem->Name = trim(strip_tags($MeetItem->Name));
    38       $Category = trim(GetTextBetween($Item, ' rel="nofollow">', '</a></span>'));
    39       $MeetItem->Age = trim(GetTextBetween($Item, ' rel="nofollow">', '</a></span>'));
     33      $Category = trim(GetTextBetween($Item, '" >', '</a>'));
     34      $MeetItem->Age = trim(GetTextBetween($Item, '" >', '</a>'));
    4035      $MeetItem->Age = trim(str_replace('let', '', $MeetItem->Age));
    41       $MeetItem->Location = trim(GetTextBetween($Item, ' rel="nofollow">', '</a></span>'));
    42       $MeetItem->Time = HumanDateToTime(trim(GetTextBetween($Item, '> </a>', '</span>')));
    43       $MeetItem->Message = trim(strip_tags(GetTextBetween($Item, 'margin-top:10px;\'>', '</div>')));
     36      $MeetItem->Location = trim(GetTextBetween($Item, '" >', '</a>'));
     37      $MeetItem->Time = trim(GetTextBetween($Item, 'TOP</a> &nbsp;', '</span>'));
     38      if ($MeetItem->Time == 'Včera') $MeetItem->Time = HumanDate(time() - 60*60*24);
     39        else if ($MeetItem->Time == 'Dnes') $MeetItem->Time = HumanDate(time());     
     40      $MeetItem->Time = HumanDateToTime($MeetItem->Time);
     41      $MeetItem->Message = trim(strip_tags(GetTextBetween($Item, '<p>', '</p>')));
    4442      $MeetItem->Link = GetTextBetween($Item, "<a href='", "'");
    4543      while (substr($MeetItem->Link, 0, 3) == '../')
     
    5452      $this->AddedCount += $MeetItem->AddIfNotExist();
    5553    }
     54    return $Output;
    5655  }
    5756}
  • trunk/Modules/Meet/Import/TanecniSkola.php

    r32 r37  
    55  function Import()
    66  {
     7    $Output = '';
    78    $HeightRange = array(
    89      '< 120 cm' => 120,
     
    2627    );
    2728
    28     parent::Import();
     29    $Output = parent::Import();
    2930    $Content = file_get_contents($this->URL);
    3031
     
    3435    if ($Content == '')
    3536    {
    36       echo('Main block not isolated.</br>');
    37       return;
     37      $Output .= 'Main block not isolated.</br>';
     38      return $Output;
    3839    }
    3940
     
    9495      }
    9596    }
     97    return $Output;
    9698  }
    9799}
  • trunk/Modules/Meet/Import/Vavruska.php

    r31 r37  
    55  function Import()
    66  {
    7     parent::Import();
     7    $Output = parent::Import();
    88    $Content = file_get_contents($this->URL);
    99
     
    1313    if ($Content == '')
    1414    {
    15       echo('Main block not isolated.</br>');
    16       return;
     15      $Output .= 'Main block not isolated.</br>';
     16      return $Output;
    1717    }
    1818
     
    4141      $this->AddedCount += $MeetItem->AddIfNotExist();
    4242    }
     43    return $Output;
    4344  }
    4445}
Note: See TracChangeset for help on using the changeset viewer.