aboutsummaryrefslogtreecommitdiffstats
path: root/include/socgraph.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-08-05 20:15:33 -0700
committerfriendica <info@friendica.com>2013-08-05 20:15:33 -0700
commit8d2debca7e950f1978e9e1a935e6935c2c4f75a0 (patch)
tree887ed772e093a1b829f244f704cb74909c627557 /include/socgraph.php
parentc2f97f7490cd96e92432ca6c397dce2f6ab80eaa (diff)
downloadvolse-hubzilla-8d2debca7e950f1978e9e1a935e6935c2c4f75a0.tar.gz
volse-hubzilla-8d2debca7e950f1978e9e1a935e6935c2c4f75a0.tar.bz2
volse-hubzilla-8d2debca7e950f1978e9e1a935e6935c2c4f75a0.zip
prune old suggested channels
Diffstat (limited to 'include/socgraph.php')
-rw-r--r--include/socgraph.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/socgraph.php b/include/socgraph.php
index f46a7059a..bf23a90df 100644
--- a/include/socgraph.php
+++ b/include/socgraph.php
@@ -326,9 +326,19 @@ function update_suggestions() {
if(! $url)
return;
+
+
$ret = z_fetch_url($url);
if($ret['success']) {
+
+ // We will grab fresh data once a day via the poller. Remove anything over a week old because
+ // the targets may have changed their preferences and don't want to be suggested - and they
+ // may have simply gone away.
+
+ $r = q("delete from xlink where xlink_xchan = '' and xlink_updated < UTC_TIMESTAMP() - INTERVAL 7 DAY");
+
+
$j = json_decode($ret['body'],true);
if($j && $j['success']) {
foreach($j['entries'] as $host) {