1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-11 19:14:09 +02:00

[bridges] Define max items and clear caches

This commit is contained in:
logmanoriginal
2016-09-05 20:26:45 +02:00
parent f1fb527607
commit 2861a855e4
12 changed files with 43 additions and 25 deletions

View File

@@ -78,20 +78,22 @@ class FuturaSciencesBridge extends FeedExpander {
)
));
public function collectData(){
public function collectData(){
$url = self::URI . 'rss/' . $this->getInput('feed') . '.xml';
$this->collectExpandableDatas($url);
}
$this->collectExpandableDatas($url, 10);
}
protected function parseItem($newsItem){
$item = $this->parseRSS_2_0_Item($newsItem);
protected function parseItem($newsItem){
$item = $this->parseRSS_2_0_Item($newsItem);
$item['uri'] = str_replace('#xtor=RSS-8', '', $item['uri']);
if($this->get_cached_time($item['uri']) <= strtotime('-24 hours'))
$this->remove_from_cache($item['uri']);
$article = $this->get_cached($item['uri'])
or $this->returnServerError('Could not request Futura-Sciences: ' . $item['uri']);
$item['content'] = $this->ExtractArticleContent($article);
$item['author'] = empty($this->ExtractAuthor($article)) ? $item['author'] : $this->ExtractAuthor($article);
return $item;
}
return $item;
}
function StripWithDelimiters($string, $start, $end) {
while (strpos($string, $start) !== false) {