}
@router.get(fba.config["base_url"] + "/api/top.json", response_class=JSONResponse)
-def top(blocked: int = None, blockers: int = None, reference: int = None, software: int = None):
+def top(blocked: int = None, blockers: int = None, reference: int = None, software: int = None, originator: int = None):
if blocked != None:
if blocked > 500:
raise HTTPException(status_code=400, detail="Too many results")
if software > 500:
raise HTTPException(status_code=400, detail="Too many results")
fba.cursor.execute("SELECT software, COUNT(domain) FROM instances WHERE software IS NOT NULL GROUP BY software ORDER BY COUNT(domain) DESC, software ASC LIMIT ?", [software])
+ elif originator != None:
+ if originator > 500:
+ raise HTTPException(status_code=400, detail="Too many results")
+ fba.cursor.execute("SELECT originator, COUNT(domain) FROM instances WHERE originator IS NOT NULL GROUP BY originator ORDER BY COUNT(domain) DESC, originator ASC LIMIT ?", [originator])
else:
raise HTTPException(status_code=400, detail="No filter specified")
return JSONResponse(status_code=200, content={})
@router.get(fba.config["base_url"] + "/scoreboard")
-def index(request: Request, blockers: int = None, blocked: int = None, reference: int = None, software: int = None):
+def index(request: Request, blockers: int = None, blocked: int = None, reference: int = None, software: int = None, originator: int = None):
scores = None
if blockers != None and blockers > 0:
res = requests.get(f"http://{fba.config['host']}:{fba.config['port']}{fba.config['base_url']}/api/top.json?reference={reference}")
elif software != None and software > 0:
res = requests.get(f"http://{fba.config['host']}:{fba.config['port']}{fba.config['base_url']}/api/top.json?software={software}")
+ elif originator != None and originator > 0:
+ res = requests.get(f"http://{fba.config['host']}:{fba.config['port']}{fba.config['base_url']}/api/top.json?originator={originator}")
else:
raise HTTPException(status_code=400, detail="No filter specified")
"blocked" : blocked,
"reference" : reference,
"software" : software,
+ "originator": originator,
"scores" : res.json()
})
<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>
+ <a href="{{base_url}}/scoreboard?software=50">used software</a> /
+ <a href="{{base_url}}/scoreboard?originator=10">originators</a>
</p>
<div class="info">
known instances: {{info.known_instances}}<br/>
text-align: center;
font-family: sans;
}
+ pre {
+ margin: 0px;
+ }
.block_level {
background-color: #1c1c3c;
width: 80em;
<td>
{% if software %}
{{entry['domain']}}
+ {% elif originator %}
+ <pre>{{entry['domain']}}</pre>
{% else %}
<a href="{{base_url}}/?{% if blockers %}reverse{% elif blocked or reference %}domain{% endif %}={{entry['domain']}}" rel="nofollow noopener noreferrer">{{entry['domain']}}</a>
<a class="listlink" href="https://{{entry['domain']}}" rel="external" target="_blank">↗</a>
</table>
</div>
<div class="info">
+ <a href="{{base_url}}/">Index</a> /
source code: <a href="https://git.mxchange.org/?p=fba.git;a=summary" rel="source" target="_blank">git.mxchange.org</a><br /><br />
{{slogan}}
</div>