This commit is contained in:
Diogo Peralta Cordeiro 2021-03-29 09:24:15 +01:00
parent 3974b1f596
commit 0a314f26db
2 changed files with 96 additions and 1 deletions

View File

@ -11,7 +11,7 @@
<aside>The free/libre software social networking platform.</aside>
<li><a href="v2/">Version 2</a></li>
<li><a href="">Version 2</a></li>
<li><a href="v3/">Version 3</a></li>

try/index.php Normal file
View File

@ -0,0 +1,95 @@
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>GNU social &mdash; a free software social networking platform</title>
#nodes {
font-family: Helvetica, Arial, sans-serif;
border-collapse: collapse;
width: 100%;
#nodes td, #nodes th {
border: 1px solid #ddd;
padding: 8px;
#nodes tr:nth-child(even){background-color: #f2f2f2;}
#nodes tr:hover {background-color: #ddd;}
#nodes th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #A22430;
color: white;
<h1>GNU social</h1>
<aside>The free/libre software social networking platform.</aside>
<li><a href="/">Home</a></li>
$query = urlencode('
nodes(platform: "gnusocial") {
$query_result = json_decode(file_get_contents("{$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
<h2>Try GNU social</h2>
<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">
<?php foreach ($nodes as $node): ?>
<a href="https://<?php echo $node['host']; ?>"><?php echo $node['name']; ?></a>
<?php echo $node['countryCode']; ?>
<?php endforeach; ?>
<p><br>This table's data comes from <a href="">the federation - a statistics hub</a>, if
you want to be listed here, please go to<yournode.tld>.
After some seconds, you should see your node added.</p>