mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-23 23:16:53 +00:00
Update BastaBridge.php
This commit is contained in:
parent
04fe9df3a4
commit
654985cc8c
@ -11,11 +11,7 @@ class BastaBridge extends BridgeAbstract{
|
||||
|
||||
public function collectData(array $param){
|
||||
|
||||
function BastaStripCDATA($string) {
|
||||
$string = str_replace('<![CDATA[', '', $string);
|
||||
$string = str_replace(']]>', '', $string);
|
||||
return $string;
|
||||
}
|
||||
|
||||
function BastaExtractContent($url) {
|
||||
$html2 = file_get_html($url);
|
||||
$text = $html2->find('div.texte', 0)->innertext;
|
||||
@ -27,8 +23,8 @@ class BastaBridge extends BridgeAbstract{
|
||||
foreach($html->find('item') as $element) {
|
||||
if($limit < 10) {
|
||||
$item = new \Item();
|
||||
$item->title = BastaStripCDATA($element->find('title', 0)->innertext);
|
||||
$item->uri = BastaStripCDATA($element->find('guid', 0)->plaintext);
|
||||
$item->title = $element->find('title', 0)->innertext;
|
||||
$item->uri = $element->find('guid', 0)->plaintext;
|
||||
$item->timestamp = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item->content = BastaExtractContent($item->uri);
|
||||
$this->items[] = $item;
|
||||
@ -48,5 +44,6 @@ class BastaBridge extends BridgeAbstract{
|
||||
|
||||
public function getCacheDuration(){
|
||||
return 3600*2; // 2 hours
|
||||
// return 0; // 2 hours
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user