mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-24 07:26:53 +00:00
run phpcbf on BloombergBridge
This commit is contained in:
parent
b4d0098c8a
commit
f7106c3137
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
class BloombergBridge extends BridgeAbstract {
|
||||
class BloombergBridge extends BridgeAbstract
|
||||
{
|
||||
const NAME = 'Bloomberg';
|
||||
const URI = 'https://www.bloomberg.com/';
|
||||
const DESCRIPTION = 'Trending stories from Bloomberg';
|
||||
@ -15,7 +16,8 @@ class BloombergBridge extends BridgeAbstract {
|
||||
)
|
||||
);
|
||||
|
||||
public function getName(){
|
||||
public function getName()
|
||||
{
|
||||
switch($this->queriedContext) {
|
||||
case 'Trending Stories':
|
||||
return self::NAME . ' Trending Stories';
|
||||
@ -29,10 +31,11 @@ class BloombergBridge extends BridgeAbstract {
|
||||
return parent::getName();
|
||||
}
|
||||
|
||||
public function collectData(){
|
||||
public function collectData()
|
||||
{
|
||||
switch($this->queriedContext) {
|
||||
case 'Trending Stories': // Get list of top new <article>s from the front page.
|
||||
$html = getSimpleHTMLDOMCached($this->getURI(),300);
|
||||
$html = getSimpleHTMLDOMCached($this->getURI(), 300);
|
||||
$stories = $html->find('ul.top-news-v3__stories article.top-news-v3-story');
|
||||
break;
|
||||
case 'From Search': // Get list of <article> elements from search.
|
||||
@ -51,7 +54,7 @@ class BloombergBridge extends BridgeAbstract {
|
||||
}
|
||||
$item['title'] = $element->find('h1 a', 0)->plaintext;
|
||||
$item['timestamp'] = strtotime($articleHtml->find('meta[name=iso-8601-publish-date],meta[name=date]', 0)->content);
|
||||
$item['content'] = $articleHtml->find('meta[name=description]',0)->content;
|
||||
$item['content'] = $articleHtml->find('meta[name=description]', 0)->content;
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user