summaryrefslogtreecommitdiff
path: root/nodegen
diff options
context:
space:
mode:
authorz3bra <contactatz3bradotorg>2016-11-25 17:43:20 +0100
committerz3bra <contactatz3bradotorg>2016-11-25 17:43:20 +0100
commit5da24ad613bb88ee63c3d4447d1563ad95f0ea52 (patch)
tree3756d8fdb554f70896d7ee65d3f6c20e569e5ea0 /nodegen
parentab7bdb2634ca1866bb9c8db53e7f5848b8146f8e (diff)
nodegen: Keep only online nodes (.last_ping > 0)
Updated nodes.h to match this criteria as well
Diffstat (limited to 'nodegen')
-rwxr-xr-xnodegen4
1 files changed, 2 insertions, 2 deletions
diff --git a/nodegen b/nodegen
index aac6920..8134198 100755
--- a/nodegen
+++ b/nodegen
@@ -2,8 +2,8 @@
echo 'static struct node nodes[] = {'
-curl https://nodes.tox.chat/json |
-jq --tab '[.nodes[] | {".addr4": .ipv4, ".addr6": .ipv6, ".port": .port, ".idstr": .public_key}]' |
+curl -s https://nodes.tox.chat/json |
+jq --tab '[.nodes[] | select(.last_ping > 0) | {".addr4": .ipv4, ".addr6": .ipv6, ".port": .port, ".idstr": .public_key}]' |
sed 's/"-"/NULL/; s/"\(\.[0-9a-z]\+\)":/\1 =/; 1d; $d'
echo '};'