]> git.mxchange.org Git - friendica.git/commitdiff
Include the server list from the-federation.info
authorMichael Vogel <icarus@dabo.de>
Sun, 6 Sep 2015 10:20:31 +0000 (12:20 +0200)
committerMichael Vogel <icarus@dabo.de>
Sun, 6 Sep 2015 10:20:31 +0000 (12:20 +0200)
include/socgraph.php

index 002623c16ef6ce2c27d19cf92da0fa43a866eca6..97daae1d2eecd5c7be526e1eb7d5fed03bd4d2f3 100644 (file)
@@ -1255,8 +1255,34 @@ function update_suggestions() {
        }
 }
 
+function poco_discover_federation() {
+       $last = get_config('poco','last_federation_discovery');
+
+       if($last) {
+               $next = $last + (24 * 60 * 60);
+               if($next > time())
+                       return;
+       }
+
+       $serverdata = fetch_url("http://the-federation.info/pods.json");
+
+       if (!$serverdata)
+               return;
+
+       $servers = json_decode($serverdata);
+
+       foreach($servers->pods AS $server)
+               poco_check_server("https://".$server->host);
+
+       set_config('poco','last_federation_discovery', time());
+
+}
+
 function poco_discover($complete = false) {
 
+       // Update the server list
+       poco_discover_federation();
+
        $no_of_queries = 5;
 
        $requery_days = intval(get_config("system", "poco_requery_days"));