diff options
author | pranomostro <pranomestro@gmail.com> | 2016-11-02 09:56:37 +0100 |
---|---|---|
committer | z3bra <contactatz3bradotorg> | 2016-11-08 16:47:51 +0100 |
commit | 1450809b32bbf4c15bd084c6b3b003698fb7e107 (patch) | |
tree | 5ea7c2c7dc93df236cbb66d22983bf4982f6566f /nodegen | |
parent | a1d2b63e6af32685f5828c302a0d3edeeb48090f (diff) |
Add generating nodes from the available nodes.tox.chat API.
Diffstat (limited to 'nodegen')
-rwxr-xr-x | nodegen | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -0,0 +1,9 @@ +#!/bin/sh + +echo 'static struct node nodes[] = {' + +curl https://nodes.tox.chat/json | +jq --tab '[.nodes[] | {".addr4": .ipv4, ".addr6": .ipv6, ".port": .port, ".idstr": .public_key}]' | +sed 's/"-"/NULL/; s/"\(\.[0-9a-z]\+\)":/\1 =/; 1d; $d' + +echo '};' |