diff options
author | emkael <emkael@tlen.pl> | 2019-02-01 00:56:20 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2019-02-01 00:56:20 +0100 |
commit | c4283763618a8e382dba7e70b06e1d3a908cd6c2 (patch) | |
tree | 59d03331e1bdf0a81265d5cba873346d2de52fd3 /providers | |
parent | d52372b1dccf6fd0c1a3ccaaf5366d6e64a658dc (diff) |
Debug option added to Facebook provider
Diffstat (limited to 'providers')
-rw-r--r-- | providers/Facebook.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/providers/Facebook.php b/providers/Facebook.php index 5698b93..e2afef6 100644 --- a/providers/Facebook.php +++ b/providers/Facebook.php @@ -7,8 +7,7 @@ require_once('Item.php'); class Facebook extends \Providers\HtmlFeed { - //protected $_cacheTimeout = '5 minutes'; - protected $_cacheTimeout = '1 second'; + protected $_cacheTimeout = '5 minutes'; protected function _getCachePath() { return '../cache/facebook.%s'; @@ -22,7 +21,18 @@ class Facebook extends \Providers\HtmlFeed { return 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0'; } + protected function _getItems() { + if (isset($this->_options['dump'])) { + $this->_cacheTimeout = '1 second'; + } + return parent::_getItems(); + } + protected function _parseFeedContent($tree) { + if (isset($this->_options['dump'])) { + print($tree->html()); + die(); + } $items = []; foreach ($tree->find('div[data-ft]') as $div) { $data = json_decode($div->attr()['data-ft'], TRUE); |