mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-23 23:16:53 +00:00
Add LinuxTodayBridge.php
LinuxToday http://www.linuxtoday.com/ Returns the daily posts from Linux Today (full text)
This commit is contained in:
parent
8f3c56b184
commit
b46bdd33d4
24
bridges/LinuxTodayBridge.php
Normal file
24
bridges/LinuxTodayBridge.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
class LinuxTodayBridge extends FeedExpander {
|
||||||
|
|
||||||
|
const MAINTAINER = "duke";
|
||||||
|
const NAME = "LinuxToday";
|
||||||
|
const URI = "http://www.linuxtoday.com/";
|
||||||
|
const DESCRIPTION = "Returns the daily posts from Linux Today (full text)";
|
||||||
|
|
||||||
|
public function collectData(){
|
||||||
|
$html = getSimpleHTMLDOM(self::URI) or returnServerError('Could not request LinuxToday.');
|
||||||
|
foreach ($html->find('div.index') as $element) {
|
||||||
|
$item = array();
|
||||||
|
$anav = $element->find('a.nav',0);
|
||||||
|
$uri = $anav->href;
|
||||||
|
$item['uri'] = $uri;
|
||||||
|
$item['title'] = "<a href=".$uri."/>".$anav->find('strong',0)->innertext."</a>";
|
||||||
|
$time = $element->find('span.sub',0)->innertext;
|
||||||
|
$time = preg_split('/ +/',$time,-1);
|
||||||
|
$item['timestamp'] = $time[0];
|
||||||
|
$item['content'] = $element->find('p',0)->innertext;
|
||||||
|
$this->items[] = $item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user