]> git.mxchange.org Git - fba.git/blobdiff - index.html
Continued:
[fba.git] / index.html
index 2e81835748296570b10e2c34117787b79547ad67..6bd9f80f8eec300f7dbda851fabcaf399395dcb9 100644 (file)
@@ -1,19 +1,48 @@
 <!DOCTYPE html>
 <head>
     <title>fedi-block-api{% if domain %} {{domain}}{% endif %}</title>
+    <link rel="alternate" type="application/rss+xml" title="RSS Feed for latest blocked instances" href="{{base_url}}/rss" />
+    {% if domain %}
+    <link rel="alternate" type="application/rss+xml" title="RSS Feed for blocked domain {{domain}}" href="{{base_url}}/rss?domain={{domain}}" />
+    {% elif reverse %}
+    <link rel="alternate" type="application/rss+xml" title="RSS Feed for blocking domain {{reverse}}" href="{{base_url}}/rss?reverse={{reverse}}" />
+    {% endif %}
     <style>
         body {
             background-color: #000022;
             color: #ffffff;
             text-align: center;
+            font-family: sans;
         }
         .block_level {
             background-color: #1c1c3c;
-            width: 750px;
+            width: 80em;
             padding: 5px;
             margin: auto;
             margin-top: 10px;
         }
+        .scoreboard {
+            background-color: #1c1c3c;
+            width: 40em;
+            padding: 5px;
+            margin: auto;
+            margin-top: 10px;
+        }
+        table {
+            width: 100%;
+            background-color: #2d2d4d;
+            border-spacing: 0px;
+        }
+        table tr:nth-of-type(2n) {
+            background-color: #1c1c3c;
+        }
+        table td {
+            padding: 4px;
+        }
+        .block_level table td:nth-of-type(1), .block_level table td:nth-of-type(2),
+        .block_level table td:nth-of-type(4), .block_level table td:nth-of-type(5) {
+            white-space: nowrap;
+        }
         .block {
             background-color: #2d2d4d;
             padding: 5px;
         a {
             color: #ffffff;
         }
+        a.listlink {
+            text-decoration: none;
+            font-size: 0.8em;
+        }
         .info {
             margin-top: 25px;
         }
+        input[type="text"], input[type="submit"] {
+            padding: 5px;
+            border-radius: 5px;
+            color: white;
+            background: #445;
+            font-size: 16px;
+        }
+
+        input[type="text"]:hover {
+            border-color: #f08;
+        }
+
+        input[type="submit"] {
+            cursor: pointer;
+        }
+
+        input[type="submit"]:hover {
+            border-color: #f08;
+        }
+
+        span[title] {
+            text-decoration: underline dotted;
+        }
     </style>
 </head>
 <body>
-    {% if reason %}
-        <h1>Instances that use "{{reason}}" in their Reason</h1>
-        {% for block_level in blocks.blocks %}
-            <div class="block_level">
-                <h2>{{block_level}} ({{blocks.blocks[block_level]|length}})</h2>
-                {% for block in blocks.blocks[block_level] %}
-                    <div class="block">
-                        <img src="https://chizu.love/fedi-block-api/favicons/{{block.blocker}}.png" width=16/>
-                        <b><a href="https://{{block.blocker}}">{{block.blocker}}</a></b> -> 
-                        <img src="https://chizu.love/fedi-block-api/favicons/{{block.blocked}}.png" width=16/>
-                        <b><a href="https://{{block.blocked}}">{{block.blocked}}</a></b><br/>
-                        {{block.reason}}
-                    </div>
+    {% if scoreboard %}
+        {% if blockers %}
+            <h1>Top {{blockers}} defederating instances</h1>
+        {% elif blocked %}
+            <h1>Top {{blocked}} defederated instances</h1>
+        {% elif reference %}
+            <h1>Top {{reference}} referencing instances</h1>
+        {% elif software %}
+            <h1>Top {{software}} used software</h1>
+        {% endif %}
+        <div class="scoreboard">
+            <table>
+                <th>№</th>
+                <th>{% if software %}Software{% else %}Instance{% endif %}</th>
+                <th>{% if reference %}References{% elif software %}Total{% else %}Blocks{% endif %}</th>
+                {% for entry in scores %}
+                    <tr>
+                        <td>{{loop.index}}</td>
+                        <td>
+                            {% if software %}
+                                {{entry['domain']}}
+                            {% else %}
+                                <b><a href="{{base_url}}/?{% if blockers %}reverse{% elif blocked or reference %}domain{% endif %}={{entry['domain']}}" rel="nofollow noopener noreferrer">{{entry['domain']}}</a></b>&nbsp;
+                                <a class="listlink" href="https://{{entry['domain']}}" rel="external" target="_blank">↗</a>
+                            {% endif %}
+                        </td>
+                        <td>{{entry['highscore']}}</td>
+                    </tr>
                 {% endfor %}
-            </div>
-        {% endfor %}
-    {% elif blocks %}
-        <h1>Instances that block {{domain}}</h1>
-        {% for block_level in blocks.blocks %}
+            </table>
+        </div>
+    {% elif reason or domain or reverse %}
+        {% if reason %}
+            <h1>Instances that use "{{reason}}" in their reason</h1>
+        {% elif reverse %}
+            <h1>Instances that are blocked by {{reverse}}</h1>
+        {% elif domain %}
+            <h1>Instances that block {{domain}}</h1>
+        {% endif %}
+        {% for block_level in blocks %}
             <div class="block_level" id="{{block_level}}">
-                <h2>{{block_level}} ({{blocks.blocks[block_level]|length}})</h2>
-                {% for block in blocks.blocks[block_level] %}
-                    <div class="block">
-                        <img src="https://chizu.love/fedi-block-api/favicons/{{block}}.png" width=16/>
-                        <b><a href="https://{{block}}">{{block}}</a></b><br/>
-                        {% if block_level in blocks.reasons %}
-                            {{blocks.reasons[block_level][block]}}
-                        {% endif %}
-                    </div>
-                {% endfor %}
+                <h2>{{block_level}} ({{blocks[block_level]|length}})</h2>
+                <table>
+                    <th>Blocker</th>
+                    <th>{% if block_level == 'accept' %}Accepted{% else %}Blocked{% endif %}</th>
+                    <th>Reason</th>
+                    <th>First added</th>
+                    <th>Last seen</th>
+                    {% for block in blocks[block_level] %}
+                        <tr>
+                            <td>
+                                <b><a href="https://{{block['blocker']}}" rel="nofollow noopener noreferrer">{{block['blocker']}}</a></b>
+                                {% if reason or domain %}<a class="listlink" href="{{base_url}}/?reverse={{block['blocker']}}">↘</a>{% endif %}
+                            </td>
+                            <td>
+                                <b><a href="https://{{domain or block['blocked']}}" rel="nofollow noopener noreferrer">{{block['blocked']}}</a></b>
+                                {% if reason or reverse %}<a class="listlink" href="{{base_url}}/?domain={{domain or block['blocked']}}">↘</a>{% endif %}
+                            </td>
+                            <td>{{block['reason']}}</td>
+                            <td>{{block['first_seen']}}</td>
+                            <td>{{block['last_seen']}}</td>
+                        </tr>
+                    {% endfor %}
+                </table>
             </div>
         {% endfor %}
     {% else %}
         <h1>Enter a Domain</h1>
         <form>
-            <input type="text" name="domain" placeholder="example.com" />
+            <input type="text" name="domain" placeholder="example.com" required="required" />
             <input type="submit" value="Submit" />
         </form>
         <h1>Enter a Reason</h1>
         <form>
-            <input type="text" name="reason" placeholder="free speech" />
+            <input type="text" name="reason" placeholder="free speech" required="required" />
+            <input type="submit" value="Submit" />
+        </form>
+        <h1>Reverse search</h1>
+        <form>
+            <input type="text" name="reverse" placeholder="example.com" required="required" />
             <input type="submit" value="Submit" />
         </form>
+        <p>
+            <a href="{{base_url}}/scoreboard?blockers=50">top 50 defederating</a> /
+            <a href="{{base_url}}/scoreboard?blocked=50">defederated instances</a> /
+            <a href="{{base_url}}/scoreboard?reference=50">referencing instances</a> /
+            <a href="{{base_url}}/scoreboard?software=50">used software</a>
+        </p>
         <div class="info">
             known instances: {{info.known_instances}}<br/>
             indexed instances: {{info.indexed_instances}}<br/>
             blocks recorded: {{info.blocks_recorded}}<br/>
-            source code: <a href="{{info.source_code}}">{{info.source_code}}</a>
+            errorous instances: {{info.errorous_instances}}<br/>
+            source code: <a href="https://git.mxchange.org/?p=fba.git;a=summary" rel="source" target="_blank">git.mxchange.org</a><br /><br />
+            {{info.slogan}}
         </div>
     {% endif %}
 </body>
-</html>
\ No newline at end of file
+</html>