aboutsummaryrefslogtreecommitdiff
path: root/bridges/EngadgetBridge.php
diff options
context:
space:
mode:
authorGravatar Dag <me@dvikan.no> 2022-07-01 15:10:30 +0200
committerGravatar GitHub <noreply@github.com> 2022-07-01 15:10:30 +0200
commit4f75591060d95208a301bc6bf460d875631b29cc (patch)
tree4e37d86840e8d990a563ba75d3de6f84a53cc2de /bridges/EngadgetBridge.php
parent66568e3a39c61546c09a47a5688914a0bdf3c60c (diff)
downloadrss-bridge-4f75591060d95208a301bc6bf460d875631b29cc.tar.gz
rss-bridge-4f75591060d95208a301bc6bf460d875631b29cc.tar.zst
rss-bridge-4f75591060d95208a301bc6bf460d875631b29cc.zip
Reformat codebase v4 (#2872)
Reformat code base to PSR12 Co-authored-by: rssbridge <noreply@github.com>
Diffstat (limited to 'bridges/EngadgetBridge.php')
-rw-r--r--bridges/EngadgetBridge.php46
1 files changed, 25 insertions, 21 deletions
diff --git a/bridges/EngadgetBridge.php b/bridges/EngadgetBridge.php
index cf200fa4..2bed4a4a 100644
--- a/bridges/EngadgetBridge.php
+++ b/bridges/EngadgetBridge.php
@@ -1,26 +1,30 @@
<?php
-class EngadgetBridge extends FeedExpander {
- const MAINTAINER = 'IceWreck';
- const NAME = 'Engadget Bridge';
- const URI = 'https://www.engadget.com/';
- const CACHE_TIMEOUT = 3600;
- const DESCRIPTION = 'Article content for Engadget.';
+class EngadgetBridge extends FeedExpander
+{
+ const MAINTAINER = 'IceWreck';
+ const NAME = 'Engadget Bridge';
+ const URI = 'https://www.engadget.com/';
+ const CACHE_TIMEOUT = 3600;
+ const DESCRIPTION = 'Article content for Engadget.';
- public function collectData(){
- $this->collectExpandableDatas(static::URI . 'rss.xml', 15);
- }
+ public function collectData()
+ {
+ $this->collectExpandableDatas(static::URI . 'rss.xml', 15);
+ }
- protected function parseItem($newsItem){
- $item = parent::parseItem($newsItem);
- // $articlePage gets the entire page's contents
- $articlePage = getSimpleHTMLDOM($newsItem->link);
- // figure contain's the main article image
- $article = $articlePage->find('figure', 0);
- // .article-text has the actual article
- foreach($articlePage->find('.article-text') as $element)
- $article = $article . $element;
- $item['content'] = $article;
- return $item;
- }
+ protected function parseItem($newsItem)
+ {
+ $item = parent::parseItem($newsItem);
+ // $articlePage gets the entire page's contents
+ $articlePage = getSimpleHTMLDOM($newsItem->link);
+ // figure contain's the main article image
+ $article = $articlePage->find('figure', 0);
+ // .article-text has the actual article
+ foreach ($articlePage->find('.article-text') as $element) {
+ $article = $article . $element;
+ }
+ $item['content'] = $article;
+ return $item;
+ }
}