]> git.mxchange.org Git - friendica-addons.git/commitdiff
statistics: auto-registering the server.
authorMichael Vogel <icarus@dabo.de>
Wed, 5 Feb 2014 23:23:08 +0000 (00:23 +0100)
committerMichael Vogel <icarus@dabo.de>
Wed, 5 Feb 2014 23:23:08 +0000 (00:23 +0100)
statistics_json/statistics_json.php

index 526c5224bda48eaa3a66d2b5f9b6dd814d269293..6861b130ba6c23526a4135134d88f009531386be 100644 (file)
@@ -42,11 +42,11 @@ function statistics_json_cron($a,$b) {
        $last = get_config('statistics_json','last_calucation');
 
        if($last) {
-               // Calculate all 3 hours
-               $next = $last + (180 * 60);
+               // Calculate all 6 hours
+               $next = $last + (360 * 60);
                if($next > time()) {
                        logger('statistics_json_cron: calculation intervall not reached');
-                       return;
+//                     return;
                }
        }
         logger('statistics_json_cron: cron_start');
@@ -102,6 +102,12 @@ function statistics_json_cron($a,$b) {
 
         logger('statistics_json_cron: local_posts: '.$local_posts, LOGGER_DEBUG);
 
+       // Now trying to register
+       $url = "http://pods.jasonrobinson.me/register/".$a->get_hostname();
+        logger('statistics_json_cron: registering url: '.$url, LOGGER_DEBUG);
+       $ret = fetch_url($url);
+        logger('statistics_json_cron: registering answer: '.$ret, LOGGER_DEBUG);
+
         logger('statistics_json_cron: cron_end');
        set_config('statistics_json','last_calucation', time());
 }