mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-04 01:55:21 +02:00
[bridges] Define max items and clear caches
This commit is contained in:
parent
f1fb527607
commit
2861a855e4
12 changed files with 43 additions and 25 deletions
|
@ -7,7 +7,7 @@ class CommonDreamsBridge extends FeedExpander {
|
|||
const DESCRIPTION = "Returns the newest articles.";
|
||||
|
||||
public function collectData(){
|
||||
$this->collectExpandableDatas('http://www.commondreams.org/rss.xml');
|
||||
$this->collectExpandableDatas('http://www.commondreams.org/rss.xml', 10);
|
||||
}
|
||||
|
||||
protected function parseItem($newsItem){
|
||||
|
@ -17,6 +17,8 @@ class CommonDreamsBridge extends FeedExpander {
|
|||
}
|
||||
|
||||
private function CommonDreamsExtractContent($url) {
|
||||
if($this->get_cached_time($url) <= strtotime('-24 hours'))
|
||||
$this->remove_from_cache($url);
|
||||
$html3 = $this->get_cached($url);
|
||||
$text = $html3->find('div[class=field--type-text-with-summary]', 0)->innertext;
|
||||
$html3->clear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue