+ $statistics["services"] = array();
+ $statistics["services"]["appnet"] = statistics_json_plugin_enabled("appnet");
+ $statistics["services"]["blogger"] = statistics_json_plugin_enabled("blogger");
+ $statistics["services"]["buffer"] = statistics_json_plugin_enabled("buffer");
+ $statistics["services"]["dreamwidth"] = statistics_json_plugin_enabled("dwpost");
+ $statistics["services"]["facebook"] = statistics_json_plugin_enabled("fbpost");
+ $statistics["services"]["gnusocial"] = statistics_json_plugin_enabled("statusnet");
+ $statistics["services"]["googleplus"] = statistics_json_plugin_enabled("gpluspost");
+ $statistics["services"]["libertree"] = statistics_json_plugin_enabled("libertree");
+ $statistics["services"]["livejournal"] = statistics_json_plugin_enabled("ljpost");
+ $statistics["services"]["pumpio"] = statistics_json_plugin_enabled("pumpio");
+ $statistics["services"]["twitter"] = statistics_json_plugin_enabled("twitter");
+ $statistics["services"]["tumblr"] = statistics_json_plugin_enabled("tumblr");
+ $statistics["services"]["wordpress"] = statistics_json_plugin_enabled("wppost");
+
+ $statistics["appnet"] = $statistics["services"]["appnet"];
+ $statistics["blogger"] = $statistics["services"]["blogger"];
+ $statistics["buffer"] = $statistics["services"]["buffer"];
+ $statistics["dreamwidth"] = $statistics["services"]["dreamwidth"];
+ $statistics["facebook"] = $statistics["services"]["facebook"];
+ $statistics["gnusocial"] = $statistics["services"]["gnusocial"];
+ $statistics["googleplus"] = $statistics["services"]["googleplus"];
+ $statistics["libertree"] = $statistics["services"]["libertree"];
+ $statistics["livejournal"] = $statistics["services"]["livejournal"];
+ $statistics["pumpio"] = $statistics["services"]["pumpio"];
+ $statistics["twitter"] = $statistics["services"]["twitter"];
+ $statistics["tumblr"] = $statistics["services"]["tumblr"];
+ $statistics["wordpress"] = $statistics["services"]["wordpress"];
+
+ header("Content-Type: application/json");
+ echo json_encode($statistics);
+ logger("statistics_init: printed ".print_r($statistics, true));
+ killme();
+}
+
+function statistics_json_cron($a,$b) {
+ $last = get_config('statistics_json','last_calucation');
+
+ if($last) {
+ // Calculate every 24 hours
+ $next = $last + (24 * 60 * 60);
+ if($next > time()) {
+ logger('statistics_json_cron: calculation intervall not reached');
+ return;
+ }
+ }
+ logger('statistics_json_cron: cron_start');
+
+