From 1f931c0e3c687d91e53fdf1b6337febc8125bd74 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 27 Mar 2014 16:40:10 -0700 Subject: firehose: provide system prefs to allow folks to fine tune to their needs --- include/expire.php | 13 +++++++++++-- include/externals.php | 6 +++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/include/expire.php b/include/expire.php index ee9956ef3..efce64ee4 100644 --- a/include/expire.php +++ b/include/expire.php @@ -29,10 +29,19 @@ function expire_run($argv, $argc){ } } + $x = get_sys_channel(); - if($x) - item_expire($x['channel_id'],30); + if($x) { + + // this should probably just fetch the channel_expire_days from the sys channel, + // but there's no convenient way to set it. + $expire_days = get_config('externals','expire_days'); + if($expire_days === false) + $expire_days = 30; + if($expire_days) + item_expire($x['channel_id'],$expire_days); + } return; } diff --git a/include/externals.php b/include/externals.php index 48aeaf6b3..946931033 100644 --- a/include/externals.php +++ b/include/externals.php @@ -28,7 +28,11 @@ function externals_run($argv, $argc){ } if($url) { - $feedurl = $url . '/zotfeed?f=&mindate=' . urlencode(datetime_convert('','','now - 15 days')); + $days = intval(getconfig('externals','since_days')); + if($days === false) + $days = 15; + + $feedurl = $url . '/zotfeed?f=&mindate=' . urlencode(datetime_convert('','','now - ' . $days . ' days')); $x = z_fetch_url($feedurl); if(($x) && ($x['success'])) { -- cgit v1.2.3