MemoLinux SegFaultMint fixes

This commit is contained in:
Mitsukarenai 2014-07-08 16:39:57 +02:00
parent 206bcdf712
commit b6602fc8e3
2 changed files with 12 additions and 16 deletions

View file

@ -1,15 +1,13 @@
<?php
/**
* @name MemoLinux
* @description Returns the 20 newest posts from MemoLinux (full text)
*@maintainer qwertygc
* @homepage http://memo-linux.com/
* @description Returns the 10 newest posts from MemoLinux (full text)
* @maintainer qwertygc
* @update 2014-07-07
*/
class MemoLinuxBridge extends BridgeAbstract{
public function collectData(array $param){
function StripCDATA($string) {
@ -22,6 +20,7 @@ class MemoLinuxBridge extends BridgeAbstract{
$text = $html2->find('div.post-content', 0)->innertext;
$text = preg_replace('@<script[^>]*?>.*?</script>@si', '', $text);
$text = preg_replace('@<div[^>]*?>.*?</div>@si', '', $text);
$text = preg_replace("/<h1.*/", '', $text);
return $text;
}
$html = file_get_html('http://memo-linux.com/feed/') or $this->returnError('Could not request MemoLinux.', 404);
@ -50,7 +49,6 @@ class MemoLinuxBridge extends BridgeAbstract{
}
public function getCacheDuration(){
// return 3600; // 1 hour
return 0; // 1 hour
return 3600*12; // 12 hours
}
}

View file

@ -1,11 +1,10 @@
<?php
/**
* RssBridgeSegfaultMint
* Returns the 10 newest posts from http://segfault.linuxmint.com (full text)
*
* @name SegfaultMint
* @description Returns the 20 newest posts from SegfaultMint (full text)
*@maintainer qwertygc
* @homepage http://segfault.linuxmint.com/
* @description Returns the 5 newest posts from SegfaultMint (full text)
* @maintainer qwertygc
* @update 2014-07-05
*/
class SegfaultMintBridge extends BridgeAbstract{
@ -30,7 +29,7 @@ class SegfaultMintBridge extends BridgeAbstract{
$limit = 0;
foreach($html->find('item') as $element) {
if($limit < 10) {
if($limit < 5) {
$item = new \Item();
$item->title = StripCDATA($element->find('title', 0)->innertext);
$item->uri = StripCDATA($element->find('guid', 0)->plaintext);
@ -52,7 +51,6 @@ class SegfaultMintBridge extends BridgeAbstract{
}
public function getCacheDuration(){
// return 3600; // 1 hour
return 0; // 1 hour
return 3600*24; // 24 hours
}
}