gnusocial.rocks/communities/index.php

112 lines
3.5 KiB
PHP
Raw Normal View History

2021-03-29 09:24:15 +01:00
<!DOCTYPE html>
<html lang="en">
2021-03-31 13:26:32 +01:00
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>GNU social &mdash; Some public communities</title>
<link rel="stylesheet" href="https://unpkg.com/purecss@2.0.5/build/pure-min.css">
<link rel="stylesheet" href="https://unpkg.com/purecss@2.0.5/build/grids-responsive-min.css">
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css">
2021-03-31 13:47:00 +01:00
<link rel="stylesheet" href="/assets/css/style.css">
2021-03-31 13:26:32 +01:00
<style>
.content-wrapper {
top: 2em;
}
#nodes {
font-family: Helvetica, Arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
2021-03-29 09:24:15 +01:00
2021-03-31 13:26:32 +01:00
#nodes td, #nodes th {
border: 1px solid #ddd;
padding: 8px;
}
2021-03-29 09:24:15 +01:00
2021-03-31 13:26:32 +01:00
#nodes tr:nth-child(even){background-color: #f2f2f2;}
2021-03-29 09:24:15 +01:00
2021-03-31 13:26:32 +01:00
#nodes tr:hover {background-color: #ddd;}
2021-03-29 09:24:15 +01:00
2021-03-31 13:26:32 +01:00
#nodes th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #A22430;
color: white;
}
</style>
<?php
$query = urlencode('
{
nodes(platform: "gnusocial") {
openSignups
name
host
countryCode
}
}
');
$query_result = json_decode(file_get_contents("https://the-federation.info/graphql?query={$query}"), true);
$query_result = $query_result['data']['nodes'];
// Filter out instances with closed signups
$nodes = array_filter($query_result, function ($node) {
return $node['openSignups'];
});
// garbage collect
unset($query_result);
?>
</head>
2021-03-29 09:24:15 +01:00
2021-03-31 13:26:32 +01:00
<body>
<header>
<div class="header">
<div class="home-menu pure-menu pure-menu-horizontal pure-menu-fixed">
<a class="pure-menu-heading" href="/">GNU social</a>
<ul class="pure-menu-list">
<li class="pure-menu-item"><a href="/" class="pure-menu-link">Home</a></li>
<li class="pure-menu-item"><a href="https://gnusocial.network/" class="pure-menu-link">Version 2</a></li>
<li class="pure-menu-item"><a href="/v3" class="pure-menu-link">Version 3</a></li>
</ul>
</div>
</header>
<div class="content-wrapper">
<div class="content">
2021-03-29 09:24:15 +01:00
2021-03-31 13:26:32 +01:00
<h2 class="content-head is-center">Some public GNU social communities</h2>
2021-03-29 09:24:15 +01:00
<p>Please note that the servers listed here are not run by us and we are not responsible for their operation or
their content. They are listed here as a service to the community.</p>
<h3>Public GNU social Servers</h3>
<table id="nodes">
<thead>
<tr>
<th>Name</th>
<th>Country</th>
</tr>
</thead>
<tbody>
<?php foreach ($nodes as $node): ?>
<tr>
<td>
<a href="https://<?php echo $node['host']; ?>"><?php echo $node['name']; ?></a>
</td>
<td>
<?php echo $node['countryCode']; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<p><br>This table's data comes from <a href="https://the-federation.info/">the federation - a statistics hub</a>, if
you want to be listed here, please go to https://the-federation.info/register/<yournode.tld>.
After some seconds, you should see your node added.</p>
2021-03-31 13:26:32 +01:00
</div>
<footer class="l-box is-center">
This site's source is <a href="https://code.undefinedhackers.net/GNUsocial/gnusocial.rocks">hosted here</a>.
</footer>
</div>
</body>
2021-03-29 09:24:15 +01:00
</html>