apply phpcbf for automatic style fixes
This commit is contained in:
parent
d34987f9c1
commit
fbbcd02384
1 changed files with 18 additions and 18 deletions
|
@ -1,23 +1,23 @@
|
||||||
<?php
|
<?php
|
||||||
class PcGamerBridge extends BridgeAbstract
|
class PcGamerBridge extends BridgeAbstract
|
||||||
{
|
{
|
||||||
const NAME = 'PC Gamer';
|
const NAME = 'PC Gamer';
|
||||||
const URI = 'https://www.pcgamer.com/';
|
const URI = 'https://www.pcgamer.com/';
|
||||||
const DESCRIPTION = 'PC Gamer Most Read Stories';
|
const DESCRIPTION = 'PC Gamer Most Read Stories';
|
||||||
const MAINTAINER = 'mdemoss';
|
const MAINTAINER = 'mdemoss';
|
||||||
|
|
||||||
public function collectData()
|
public function collectData()
|
||||||
{
|
{
|
||||||
$html = getSimpleHTMLDOMCached($this->getURI(), 300);
|
$html = getSimpleHTMLDOMCached($this->getURI(), 300);
|
||||||
$stories = $html->find('div#popularcontent li.most-popular-item');
|
$stories = $html->find('div#popularcontent li.most-popular-item');
|
||||||
foreach ($stories as $element) {
|
foreach ($stories as $element) {
|
||||||
$item['uri'] = $element->find('a', 0)->href;
|
$item['uri'] = $element->find('a', 0)->href;
|
||||||
$articleHtml = getSimpleHTMLDOMCached($item['uri']);
|
$articleHtml = getSimpleHTMLDOMCached($item['uri']);
|
||||||
$item['title'] = $element->find('h4 a', 0)->plaintext;
|
$item['title'] = $element->find('h4 a', 0)->plaintext;
|
||||||
$item['timestamp'] = strtotime($articleHtml->find('meta[name=pub_date]', 0)->content);
|
$item['timestamp'] = strtotime($articleHtml->find('meta[name=pub_date]', 0)->content);
|
||||||
$item['content'] = $articleHtml->find('meta[name=description]', 0)->content;
|
$item['content'] = $articleHtml->find('meta[name=description]', 0)->content;
|
||||||
$item['author'] = $articleHtml->find('a[itemprop=author]', 0)->plaintext;
|
$item['author'] = $articleHtml->find('a[itemprop=author]', 0)->plaintext;
|
||||||
$this->items[] = $item;
|
$this->items[] = $item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue