Skip to content

Commit

Permalink
[ListverseBridge - add new bridge (#1305)
Browse files Browse the repository at this point in the history
  • Loading branch information
IceWreck authored and teromene committed Oct 3, 2019
1 parent 2a3d586 commit 8c19146
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions bridges/ListverseBridge.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
class ListverseBridge extends FeedExpander {

const MAINTAINER = 'IceWreck';
const NAME = 'Listverse Bridge';
const URI = 'https://listverse.com/';
const CACHE_TIMEOUT = 3600;
const DESCRIPTION = 'RSS feed for Listverse';

public function collectData(){
$this->collectExpandableDatas('https://listverse.com/feed/', 15);
}

protected function parseItem($newsItem){
$item = parent::parseItem($newsItem);
// $articlePage gets the entire page's contents
$articlePage = getSimpleHTMLDOM($newsItem->link);
$article = $articlePage->find('#articlecontentonly', 0);
$item['content'] = $article;
return $item;
}
}

0 comments on commit 8c19146

Please sign in to comment.