summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--providers/Facebook.php14
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);