Fzn.php 675 B

123456789101112131415161718192021
  1. <?php
  2. namespace console\models\spider;
  3. class Fzn extends SpiderAbstract
  4. {
  5. protected function filterContent($content = '')
  6. {
  7. preg_match('#([\s\S]*?)<p>转载请注明#', $content, $match);
  8. $content = $match[1];
  9. $content = preg_replace('#<a([\s\S]+?)>(.*)?</a>#', '$2', $content);
  10. return $content;
  11. }
  12. protected function getCover($listNode)
  13. {
  14. $cover = strpos($listNode->parents('.excerpt')->filter('img')->attr('src'), 'http') === false ? $this->config['domain'].$listNode->parents('.excerpt')->filter('img')->attr('src') : $listNode->parents('.excerpt')->filter('img')->attr('src');
  15. return $cover;
  16. }
  17. }