summaryrefslogtreecommitdiff
path: root/providers/Facebook.php
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2019-02-01 14:38:59 +0100
committeremkael <emkael@tlen.pl>2019-02-01 14:38:59 +0100
commit28a1c14bf82d9d0a8311f8f18746d0b4cd821314 (patch)
tree6525acc4811fdf026489831a9339b79819ff7475 /providers/Facebook.php
parentc4283763618a8e382dba7e70b06e1d3a908cd6c2 (diff)
Weaponizing cache files
Diffstat (limited to 'providers/Facebook.php')
-rw-r--r--providers/Facebook.php21
1 files changed, 12 insertions, 9 deletions
diff --git a/providers/Facebook.php b/providers/Facebook.php
index e2afef6..2126189 100644
--- a/providers/Facebook.php
+++ b/providers/Facebook.php
@@ -7,7 +7,17 @@ require_once('Item.php');
class Facebook extends \Providers\HtmlFeed {
- protected $_cacheTimeout = '5 minutes';
+ protected $_cacheTimeout = '300 years';
+
+ public function __construct($feed, $options) {
+ parent::__construct($feed, $options);
+ if (isset($this->_options['dump'])) {
+ $this->_options['force'] = TRUE;
+ }
+ if (isset($this->_options['force'])) {
+ $this->_cacheTimeout = '1 second';
+ }
+ }
protected function _getCachePath() {
return '../cache/facebook.%s';
@@ -18,14 +28,7 @@ class Facebook extends \Providers\HtmlFeed {
}
protected function __getUserAgent() {
- 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();
+ return 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0.1';
}
protected function _parseFeedContent($tree) {