From 1450809b32bbf4c15bd084c6b3b003698fb7e107 Mon Sep 17 00:00:00 2001 From: pranomostro Date: Wed, 2 Nov 2016 09:56:37 +0100 Subject: Add generating nodes from the available nodes.tox.chat API. --- nodegen | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 nodegen (limited to 'nodegen') diff --git a/nodegen b/nodegen new file mode 100755 index 0000000..aac6920 --- /dev/null +++ b/nodegen @@ -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 '};' -- cgit v1.2.3