diff options
Diffstat (limited to 'providers/Beer.php')
-rw-r--r-- | providers/Beer.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/providers/Beer.php b/providers/Beer.php new file mode 100644 index 0000000..b6f11a9 --- /dev/null +++ b/providers/Beer.php @@ -0,0 +1,37 @@ +<?php + +namespace Providers; + +require_once('Facebook.php'); + +class Beer extends \Providers\Facebook { + + protected $_feedGroup; + + public function __construct($feed, $options=[]) { + parent::__construct($feed, $options); + $this->_feedGroup = $feed; + $this->_groupConfig = json_decode(file_get_contents('../config/beer.json'), TRUE); + } + + protected function _getCachePath() { + return '../cache/beer.%s'; + } + + protected function _fetchItems() { + $data = []; + foreach ($this->_groupConfig[$this->_feedGroup] as $feed) { + $this->_feed = $feed; + $data = array_merge($data, parent::_fetchItems()); + } + return $data; + } + + protected function _sortContent($content) { + usort($content, function($c1, $c2) { return $c2->Time - $c1->Time; }); + return $content; + } + +} + +?> |