index.html 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <!DOCTYPE html>
  2. <head>
  3. <title>fedi-block-api{% if domain %} {{domain}}{% endif %}</title>
  4. <style>
  5. body {
  6. background-color: #000022;
  7. color: #ffffff;
  8. text-align: center;
  9. font-family: "Open Sans", "Roboto", sans-serif;
  10. }
  11. .block_level {
  12. background-color: #1c1c3c;
  13. width: 80em;
  14. padding: 5px;
  15. margin: auto;
  16. margin-top: 10px;
  17. }
  18. .scoreboard {
  19. background-color: #1c1c3c;
  20. width: 40em;
  21. padding: 5px;
  22. margin: auto;
  23. margin-top: 10px;
  24. }
  25. table {
  26. width: 100%;
  27. background-color: #2d2d4d;
  28. border-spacing: 0px;
  29. }
  30. table tr:nth-of-type(2n) {
  31. background-color: #1c1c3c;
  32. }
  33. table td {
  34. padding: 4px;
  35. }
  36. .block_level table td:nth-of-type(1), .block_level table td:nth-of-type(2),
  37. .block_level table td:nth-of-type(4), .block_level table td:nth-of-type(5) {
  38. white-space: nowrap;
  39. }
  40. .block_level table td:nth-of-type(2) a, .scoreboard table td:nth-of-type(2) a {
  41. white-space: pre-wrap;
  42. word-wrap: anywhere;
  43. }
  44. .block {
  45. background-color: #2d2d4d;
  46. padding: 5px;
  47. margin: 5px;
  48. }
  49. a {
  50. color: #ffffff;
  51. }
  52. a.listlink {
  53. text-decoration: none;
  54. font-size: 0.8em;
  55. }
  56. .info {
  57. margin-top: 25px;
  58. }
  59. input[type="text"], input[type="submit"] {
  60. padding: 5px;
  61. border-radius: 5px;
  62. color: white;
  63. background: #445;
  64. font-size: 16px;
  65. }
  66. input[type="text"]:hover {
  67. border-color: #f08;
  68. }
  69. input[type="submit"] {
  70. cursor: pointer;
  71. }
  72. input[type="submit"]:hover {
  73. border-color: #f08;
  74. }
  75. span[title] {
  76. text-decoration: underline dotted;
  77. }
  78. textarea[name="reason"] {
  79. color: #ffffff;
  80. background: transparent;
  81. border: none;
  82. text-align: center;
  83. }
  84. </style>
  85. </head>
  86. <body>
  87. {% if scoreboard %}
  88. {% if blockers %}
  89. <h1>Top {{blockers}} defederating instances</h1>
  90. {% elif blocked %}
  91. <h1>Top {{blocked}} defederated instances</h1>
  92. {% endif %}
  93. <div class="scoreboard">
  94. <table>
  95. <th>№</th>
  96. <th>Instance</th>
  97. <th>Defederations</th>
  98. {% for entry in scores %}
  99. <tr>
  100. <td>{{loop.index}}</td>
  101. <td>
  102. <img src="https://proxy.duckduckgo.com/ip3/{{entry['domain']}}.ico" width=16/>
  103. <b><a href="../?{% if blockers %}reverse{% elif blocked %}domain{% endif %}={{entry['domain']}}" rel="nofollow noopener noreferrer">{{entry['domain']}}</a></b>&nbsp;
  104. <a class="listlink" href="https://{{entry['domain']}}">↗</a>
  105. </td>
  106. <td>{{entry['highscore']}}</td>
  107. </tr>
  108. {% endfor %}
  109. </table>
  110. </div>
  111. {% elif weighted %}
  112. <h1>Top 100 defederated instances (weighted)</h1>
  113. <p>Weighted score makes instances with lots of blocks count less than instances with fewer blocks.<br />
  114. This might provide more objective results by accounting the obvious bias from schizo instances whose block count is in thousands.</p>
  115. <div class="scoreboard">
  116. <table>
  117. <th>№</th>
  118. <th>Instance</th>
  119. <th>Defederations</th>
  120. <th>Weighted score</th>
  121. {% for entry in scores %}
  122. <tr>
  123. <td>{{loop.index}}</td>
  124. <td>
  125. <img src="https://proxy.duckduckgo.com/ip3/{{entry['domain']}}.ico" width=16/>
  126. <b><a href="../?domain={{entry['domain']}}" rel="nofollow noopener noreferrer">{{entry['domain']}}</a></b>&nbsp;
  127. <a class="listlink" href="https://{{entry['domain']}}">↗</a>
  128. </td>
  129. <td>{{entry['blocks']}}</td>
  130. <td>{{entry['weight']}}</td>
  131. </tr>
  132. {% endfor %}
  133. </table>
  134. </div>
  135. <p>Thanks, pwm!</p>
  136. {% elif reason or domain or reverse %}
  137. {% if reason %}
  138. <h1>Instances that use "{{reason}}" in their reason</h1>
  139. {% elif reverse %}
  140. <h1>Instances that are blocked by {{reverse}}</h1>
  141. {% elif domain %}
  142. <h1>Instances that block {{domain}}</h1>
  143. {% endif %}
  144. {% for block_level in blocks %}
  145. <div class="block_level" id="{{block_level}}">
  146. <h2>{{block_level}} ({{blocks[block_level]|length}})</h2>
  147. <table>
  148. <th>Blocker</th>
  149. <th>{% if block_level == 'accept' %}Accepted{% else %}Blocked{% endif %}</th>
  150. <th>Reason</th>
  151. <th>First added</th>
  152. <th>Last seen</th>
  153. {% for block in blocks[block_level] %}
  154. <tr>
  155. <td>
  156. <img src="https://proxy.duckduckgo.com/ip3/{{block['blocker']}}.ico" width=16/>
  157. <b><a href="https://{{block['blocker']}}" rel="nofollow noopener noreferrer">{{block['blocker']}}</a></b>
  158. {% if reason or domain %}<a class="listlink" href="./?reverse={{block['blocker']}}">↘</a>{% endif %}
  159. </td>
  160. <td>
  161. <img src="https://proxy.duckduckgo.com/ip3/{{domain or block['blocked']}}.ico" width=16/>
  162. <b><a href="https://{{domain or block['blocked']}}" rel="nofollow noopener noreferrer">{{block['blocked']}}</a></b>
  163. {% if reason or reverse %}<a class="listlink" href="./?domain={{domain or block['blocked']}}">↘</a>{% endif %}
  164. </td>
  165. <td>
  166. <textarea name="reason" cols="60" rows="1" readonly>{{block['reason']}}</textarea>
  167. </td>
  168. <td>{{block['first_added']}}</td>
  169. <td>{{block['last_seen']}}</td>
  170. </tr>
  171. {% endfor %}
  172. </table>
  173. </div>
  174. {% endfor %}
  175. {% else %}
  176. <h1>Enter a Domain</h1>
  177. <form>
  178. <input type="text" name="domain" placeholder="example.com" />
  179. <input type="submit" value="Submit" />
  180. </form>
  181. <h1>Enter a Reason</h1>
  182. <form>
  183. <input type="text" name="reason" placeholder="free speech" />
  184. <input type="submit" value="Submit" />
  185. </form>
  186. <h1>Reverse search</h1>
  187. <form>
  188. <input type="text" name="reverse" placeholder="example.com" />
  189. <input type="submit" value="Submit" />
  190. </form>
  191. <p>
  192. <a href="./scoreboard?blockers=50">top 50 defederating</a> / <a href="./scoreboard?blocked=50">defederated instances</a> // <a href="./weighted">weighted scoreboard</a>
  193. </p>
  194. <div class="info">
  195. known instances: {{info.known_instances}}<br/>
  196. indexed instances: {{info.indexed_instances}}<br/>
  197. blocks recorded: {{info.blocks_recorded}}<br/>
  198. source code: <a href="https://git.kiwifarms.net/mint/fedi-block-api">git.kiwifarms.net/mint/fedi-block-api</a> (<a href="https://gitgud.io/mintplg/fedi-block-api">mirror</a>)<br/><br/>
  199. fuck jannies<br/>
  200. #FreeMyNigga
  201. </div>
  202. {% endif %}
  203. </body>
  204. </html>