aboutsummaryrefslogtreecommitdiffstats
path: root/include/poller.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-03-26 18:45:01 -0700
committerfriendica <info@friendica.com>2014-03-26 18:45:01 -0700
commited14c1f224afadb5dd5417d4078f853ff97b30cb (patch)
treecd527019841d3b3bfd98e8cdefaf03154db64bb0 /include/poller.php
parent150bc9866a24303c86b78614b58b8d01a245b424 (diff)
downloadvolse-hubzilla-ed14c1f224afadb5dd5417d4078f853ff97b30cb.tar.gz
volse-hubzilla-ed14c1f224afadb5dd5417d4078f853ff97b30cb.tar.bz2
volse-hubzilla-ed14c1f224afadb5dd5417d4078f853ff97b30cb.zip
more work on firehose
Diffstat (limited to 'include/poller.php')
-rw-r--r--include/poller.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/poller.php b/include/poller.php
index bae39dd2e..aa09afd5d 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -167,6 +167,30 @@ function poller_run($argv, $argc){
}
}
+ // pull in some public posts
+
+ $r = q("select site_url from site where site_url != '%s' order by rand() limit 1",
+ dbesc(z_root())
+ );
+
+ if($r) {
+ $feedurl = $r[0]['site_url'] . '/zotfeed?f=&mindate=' . urlencode(datetime_convert('','','now - 1 month'));
+ $x = z_fetch_url($feedurl);
+ if(($x) && ($x['success'])) {
+ $total = 0;
+ $j = json_decode($x['body'],true);
+ if($j['success'] && $j['messages']) {
+ require_once('include/identity.php');
+ $sys = get_sys_channel();
+ foreach($j['messages'] as $message) {
+ $results = process_delivery(array('hash' => 'undefined'), get_item_elements($message),
+ array(array('hash' => $sys['xchan_hash'])), false, true);
+ $total ++;
+ }
+ logger('import_public_posts: ' . $total . ' messages imported', LOGGER_DEBUG);
+ }
+ }
+ }
$manual_id = 0;
$generation = 0;