示例#1
0
 static function get_video_tags($html)
 {
     $paterns = self::get_video_pattern();
     foreach ($paterns as $patern) {
         $replace = parse_lib::comment_tags("<p style='text-align:center;'>{$patern['replace']}</p>");
         $html = preg_replace($patern['pattern'], $replace, $html);
     }
     return $html;
 }
示例#2
0
 function clear_txt($html)
 {
     $html = preg_replace("#<script[\\s\\S]*?</script>#i", '', $html);
     $html = preg_replace("#<iframe[\\s\\S]*?</iframe>#i", '', $html);
     $html = strip_tags($html, '<p> <img> <table> <tr> <td> <h1> <h2> <h3> <em> <i> <b> <strong> <ul> <ol> <li> <br> <center>');
     $html = parse_lib::uncomment_tags($html);
     //возврат закомментированного содержимого
     $html = $this->close_tags($html);
     return $html;
 }
示例#3
0
 protected function convertToRealUrl($dataAr, $baseUrl)
 {
     if ($dataAr == NULL) {
         return $dataAr;
     }
     foreach ($dataAr as $fstKey => $secAr) {
         foreach ($secAr as $secKey => $secVal) {
             if (!empty($secVal)) {
                 $dataAr[$fstKey][$secKey] = parse_lib::uri2absolute($secVal, $baseUrl);
             }
         }
     }
     return $dataAr;
 }
示例#4
0
 function __construct($html, $host)
 {
     $this->html = $html;
     switch ($host) {
         case 'tsn.ua':
             $this->parseMethodNmae = 'tsn';
             break;
         case 'korrespondent.net':
             $this->parseMethodNmae = 'korrespondent';
             break;
         case 'www.segodnya.ua':
             $this->parseMethodNmae = 'segodnya';
             break;
         case 'www.unn.com.ua':
             $this->parseMethodNmae = 'unn';
             break;
         case 'www.unian.net':
             $this->parseMethodNmae = 'unian';
             break;
         case 'liga.net':
             $this->parseMethodNmae = 'news_liga';
             break;
         case 'interfax.com.ua':
             $this->parseMethodNmae = 'interfax';
             break;
         case 'sport.segodnya.ua':
             $this->parseMethodNmae = 'segodnya';
             break;
         case 'delo.ua':
             $this->parseMethodNmae = 'delo';
             break;
         case 'focus.ua':
             $this->parseMethodNmae = 'focus';
             break;
         case 'isport.ua':
             $this->parseMethodNmae = 'isport';
             break;
         case 'compulenta.computerra.ru':
             $this->parseMethodNmae = 'compulenta';
             $this->html = parse_lib::validHTML($html);
             break;
         case 'itc.ua':
             $this->parseMethodNmae = 'itc';
             break;
         default:
             $this->parseMethodNmae = false;
     }
 }
示例#5
0
 function __construct()
 {
     parent::__construct();
     $this->CI->load->model('parser_m');
 }
示例#6
0
 function predParseHTML($html)
 {
     return parse_lib::validHTML($html);
 }