mirror of
https://github.com/r4sas/Niflheim-api
synced 2025-01-31 00:54:18 +00:00
30d nodes, update template
This commit is contained in:
parent
a37f5b0ec4
commit
87f5936e83
@ -93,6 +93,25 @@ class nodes24h(Resource):
|
|||||||
|
|
||||||
return nodeinfo
|
return nodeinfo
|
||||||
|
|
||||||
|
|
||||||
|
# alive nodes count for latest 30 days
|
||||||
|
class nodes30d(Resource):
|
||||||
|
def get(self):
|
||||||
|
cur = dbconn.cursor()
|
||||||
|
nodes = {}
|
||||||
|
cur.execute("SELECT * FROM timeseries ORDER BY unixtstamp DESC LIMIT 24 * 30")
|
||||||
|
for i in cur.fetchall():
|
||||||
|
nodes[i[1]] = i[0]
|
||||||
|
|
||||||
|
dbconn.commit()
|
||||||
|
cur.close()
|
||||||
|
|
||||||
|
nodeinfo = {}
|
||||||
|
nodeinfo['nodes30d'] = nodes
|
||||||
|
|
||||||
|
return nodeinfo
|
||||||
|
|
||||||
|
|
||||||
# alive nodes count for latest 24 hours
|
# alive nodes count for latest 24 hours
|
||||||
class crawlResult(Resource):
|
class crawlResult(Resource):
|
||||||
def get(self):
|
def get(self):
|
||||||
@ -122,6 +141,7 @@ def fpage():
|
|||||||
api.add_resource(nodesCurrent, '/current')
|
api.add_resource(nodesCurrent, '/current')
|
||||||
api.add_resource(nodesInfo, '/nodeinfo')
|
api.add_resource(nodesInfo, '/nodeinfo')
|
||||||
api.add_resource(nodes24h, '/nodes24h')
|
api.add_resource(nodes24h, '/nodes24h')
|
||||||
|
api.add_resource(nodes30d, '/nodes30d')
|
||||||
api.add_resource(crawlResult, '/result.json')
|
api.add_resource(crawlResult, '/result.json')
|
||||||
|
|
||||||
# regirster signal handler
|
# regirster signal handler
|
||||||
|
@ -34,11 +34,17 @@
|
|||||||
<div class="apireq">
|
<div class="apireq">
|
||||||
http://[31a:fb8a:c43e:ca59::2]/nodes24h <sup><a href="http://[31a:fb8a:c43e:ca59::2]/nodes24h" target="_blank">[⇗]</a> <a href="http://nodelist.ygg/nodes24h" target="_blank">[DNS]</a></sup>
|
http://[31a:fb8a:c43e:ca59::2]/nodes24h <sup><a href="http://[31a:fb8a:c43e:ca59::2]/nodes24h" target="_blank">[⇗]</a> <a href="http://nodelist.ygg/nodes24h" target="_blank">[DNS]</a></sup>
|
||||||
</div>
|
</div>
|
||||||
|
Active nodes count for last 30 days:<br />
|
||||||
|
<div class="apireq">
|
||||||
|
http://[31a:fb8a:c43e:ca59::2]/nodes30d <sup><a href="http://[31a:fb8a:c43e:ca59::2]/nodes30d" target="_blank">[⇗]</a> <a href="http://nodelist.ygg/nodes30d" target="_blank">[DNS]</a></sup>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="wide"></div>
|
<div class="wide"></div>
|
||||||
<strong>Get latest crawler data</strong><br />
|
<strong>Get latest crawler data</strong><br />
|
||||||
You can download data in raw json provided by <a href="https://github.com/neilalexander/yggcrawl" target="_blank">yggcrawl</a>: result.json <sup><a href="http://[31a:fb8a:c43e:ca59::2]/result.json" target="_blank">[⇗]</a> <a href="http://nodelist.ygg/result.json" target="_blank">[DNS]</a></sup>
|
You can download data in raw json provided by <a href="https://github.com/neilalexander/yggcrawl" target="_blank">yggcrawl</a>:<br />
|
||||||
<br /><br />
|
<div class="apireq">
|
||||||
|
http://[31a:fb8a:c43e:ca59::2]/result.json <sup><a href="http://[31a:fb8a:c43e:ca59::2]/result.json" target="_blank">[⇗]</a> <a href="http://nodelist.ygg/result.json" target="_blank">[DNS]</a></sup>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="wide"></div>
|
<div class="wide"></div>
|
||||||
<small>Made with <a href="https://github.com/r4sas/Niflheim-api" target="_blank">fork</a> of <a href="https://github.com/yakamok/Niflheim-api" target="_blank">Niflheim-API</a> by yakamok</small>
|
<small>Made with <a href="https://github.com/r4sas/Niflheim-api" target="_blank">fork</a> of <a href="https://github.com/yakamok/Niflheim-api" target="_blank">Niflheim-API</a> by yakamok</small>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user