Abuse mail received because of "unusual traffic"
Fixes friendica/friendica#8663
This commit is contained in:
parent
5f43f56f72
commit
8ec2b21a14
|
@ -1627,18 +1627,21 @@ class GServer
|
||||||
}
|
}
|
||||||
|
|
||||||
// Discover federated servers
|
// Discover federated servers
|
||||||
$curlResult = Network::fetchUrl("http://the-federation.info/pods.json");
|
$protocols = ['activitypub', 'diaspora', 'dfrn', 'ostatus'];
|
||||||
|
foreach ($protocols as $protocol) {
|
||||||
|
$query = '{nodes(protocol:"' . $protocol . '"){host}}';
|
||||||
|
$curlResult = Network::fetchUrl('https://the-federation.info/graphql?query=' . urlencode($query));
|
||||||
if (!empty($curlResult)) {
|
if (!empty($curlResult)) {
|
||||||
$servers = json_decode($curlResult, true);
|
$data = json_decode($curlResult, true);
|
||||||
|
if (!empty($data['data']['nodes'])) {
|
||||||
if (!empty($servers['pods'])) {
|
foreach ($data['data']['nodes'] as $server) {
|
||||||
foreach ($servers['pods'] as $server) {
|
|
||||||
// Using "only_nodeinfo" since servers that are listed on that page should always have it.
|
// Using "only_nodeinfo" since servers that are listed on that page should always have it.
|
||||||
|
echo $server['host']."\n";
|
||||||
Worker::add(PRIORITY_LOW, 'UpdateGServer', 'https://' . $server['host'], true);
|
Worker::add(PRIORITY_LOW, 'UpdateGServer', 'https://' . $server['host'], true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Disvover Mastodon servers
|
// Disvover Mastodon servers
|
||||||
$accesstoken = DI::config()->get('system', 'instances_social_key');
|
$accesstoken = DI::config()->get('system', 'instances_social_key');
|
||||||
|
|
Loading…
Reference in a new issue