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

[bridges] Change all occurrences of the Item object to array

This commit is contained in:
logmanoriginal
2016-08-22 18:55:59 +02:00
parent 1f3361c6b4
commit bf0a9d754e
130 changed files with 844 additions and 844 deletions

View File

@@ -30,26 +30,26 @@ class FourchanBridge extends BridgeAbstract{
$html = $this->getSimpleHTMLDOM($url) or $this->returnServerError("Could not request 4chan, thread not found");
foreach($html->find('div.postContainer') as $element) {
$item = new \Item();
$item->id = $element->find('.post', 0)->getAttribute('id');
$item->uri = $url.'#'.$item->id;
$item->timestamp = $element->find('span.dateTime', 0)->getAttribute('data-utc');
$item->author = $element->find('span.name', 0)->plaintext;
$item = array();
$item['id'] = $element->find('.post', 0)->getAttribute('id');
$item['uri'] = $url.'#'.$item['id'];
$item['timestamp'] = $element->find('span.dateTime', 0)->getAttribute('data-utc');
$item['author'] = $element->find('span.name', 0)->plaintext;
if(!empty($element->find('.file', 0) ) ) {
$item->image = $element->find('.file a', 0)->href;
$item->imageThumb = $element->find('.file img', 0)->src;
if(empty($item->imageThumb) and strpos($item->image, '.swf') !== FALSE)
$item->imageThumb = 'http://i.imgur.com/eO0cxf9.jpg';
$item['image'] = $element->find('.file a', 0)->href;
$item['imageThumb'] = $element->find('.file img', 0)->src;
if(!isset($item['imageThumb']) and strpos($item['image'], '.swf') !== FALSE)
$item['imageThumb'] = 'http://i.imgur.com/eO0cxf9.jpg';
}
if(!empty($element->find('span.subject', 0)->innertext )) {
$item->subject = $element->find('span.subject', 0)->innertext;
$item['subject'] = $element->find('span.subject', 0)->innertext;
}
$item->title = (!empty($item->subject) ? $item->subject.' - ' : '' ) . 'reply '.$item->id.' | '.$item->author;
$item['title'] = (isset($item['subject']) ? $item['subject'].' - ' : '' ) . 'reply '.$item['id'].' | '.$item['author'];
$item->content = (!empty($item->image) ? '<a href="'.$item->image.'"><img alt="'.$item->id.'" src="'.$item->imageThumb.'" /></a><br>' : '') . '<span id="'.$item->id.'">'.$element->find('.postMessage', 0)->innertext.'</span>';
$item['content'] = (isset($item['image']) ? '<a href="'.$item['image'].'"><img alt="'.$item['id'].'" src="'.$item['imageThumb'].'" /></a><br>' : '') . '<span id="'.$item['id'].'">'.$element->find('.postMessage', 0)->innertext.'</span>';
$this->items[] = $item;
}
$this->items = array_reverse($this->items);