diff options
author | 2022-07-01 15:10:30 +0200 | |
---|---|---|
committer | 2022-07-01 15:10:30 +0200 | |
commit | 4f75591060d95208a301bc6bf460d875631b29cc (patch) | |
tree | 4e37d86840e8d990a563ba75d3de6f84a53cc2de /bridges/NotAlwaysBridge.php | |
parent | 66568e3a39c61546c09a47a5688914a0bdf3c60c (diff) | |
download | rss-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/NotAlwaysBridge.php')
-rw-r--r-- | bridges/NotAlwaysBridge.php | 119 |
1 files changed, 62 insertions, 57 deletions
diff --git a/bridges/NotAlwaysBridge.php b/bridges/NotAlwaysBridge.php index f8e56cd6..33b619ad 100644 --- a/bridges/NotAlwaysBridge.php +++ b/bridges/NotAlwaysBridge.php @@ -1,59 +1,64 @@ <?php -class NotAlwaysBridge extends BridgeAbstract { - - const MAINTAINER = 'mozes'; - const NAME = 'Not Always family Bridge'; - const URI = 'https://notalwaysright.com/'; - const DESCRIPTION = 'Returns the latest stories'; - const CACHE_TIMEOUT = 1800; // 30 minutes - - const PARAMETERS = array( array( - 'filter' => array( - 'type' => 'list', - 'name' => 'Filter', - 'values' => array( - 'All' => '', - 'Right' => 'right', - 'Working' => 'working', - 'Romantic' => 'romantic', - 'Related' => 'related', - 'Learning' => 'learning', - 'Friendly' => 'friendly', - 'Hopeless' => 'hopeless', - 'Unfiltered' => 'unfiltered' - ) - ) - )); - - public function getIcon() { - return self::URI . 'favicon_nar.png'; - } - - public function collectData(){ - $html = getSimpleHTMLDOM($this->getURI()); - foreach($html->find('.post') as $post) { - #print_r($post); - $item = array(); - $item['uri'] = $post->find('h1', 0)->find('a', 0)->href; - $item['content'] = $post; - $item['title'] = $post->find('h1', 0)->find('a', 0)->innertext; - $this->items[] = $item; - } - } - - public function getName(){ - if(!is_null($this->getInput('filter'))) { - return $this->getInput('filter') . ' - NotAlways Bridge'; - } - - return parent::getName(); - } - - public function getURI(){ - if(!is_null($this->getInput('filter'))) { - return self::URI . $this->getInput('filter') . '/'; - } - - return parent::getURI(); - } + +class NotAlwaysBridge extends BridgeAbstract +{ + const MAINTAINER = 'mozes'; + const NAME = 'Not Always family Bridge'; + const URI = 'https://notalwaysright.com/'; + const DESCRIPTION = 'Returns the latest stories'; + const CACHE_TIMEOUT = 1800; // 30 minutes + + const PARAMETERS = [ [ + 'filter' => [ + 'type' => 'list', + 'name' => 'Filter', + 'values' => [ + 'All' => '', + 'Right' => 'right', + 'Working' => 'working', + 'Romantic' => 'romantic', + 'Related' => 'related', + 'Learning' => 'learning', + 'Friendly' => 'friendly', + 'Hopeless' => 'hopeless', + 'Unfiltered' => 'unfiltered' + ] + ] + ]]; + + public function getIcon() + { + return self::URI . 'favicon_nar.png'; + } + + public function collectData() + { + $html = getSimpleHTMLDOM($this->getURI()); + foreach ($html->find('.post') as $post) { + #print_r($post); + $item = []; + $item['uri'] = $post->find('h1', 0)->find('a', 0)->href; + $item['content'] = $post; + $item['title'] = $post->find('h1', 0)->find('a', 0)->innertext; + $this->items[] = $item; + } + } + + public function getName() + { + if (!is_null($this->getInput('filter'))) { + return $this->getInput('filter') . ' - NotAlways Bridge'; + } + + return parent::getName(); + } + + public function getURI() + { + if (!is_null($this->getInput('filter'))) { + return self::URI . $this->getInput('filter') . '/'; + } + + return parent::getURI(); + } } |