From bff9bee2dc283e950f204772598f5c14fef8f8a5 Mon Sep 17 00:00:00 2001 From: qo-op Date: Sun, 30 May 2021 22:47:55 +0200 Subject: [PATCH] swarm of friends testing --- zen/swarm_testing.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 zen/swarm_testing.sh diff --git a/zen/swarm_testing.sh b/zen/swarm_testing.sh new file mode 100755 index 0000000..1519c00 --- /dev/null +++ b/zen/swarm_testing.sh @@ -0,0 +1,19 @@ +#!/bin/bash +if [[ $(date +%s -r /tmp/liking_me) -lt $(date +%s --date="1 day ago") ]]; then + echo "...... refreshing /tmp/liking_me" + ~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" stars | jq -r '.likes[].issuer' > /tmp/liking_me +fi + +for liking_me in $(cat /tmp/liking_me); +do + echo "$liking_me is liking me" + station=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $liking_me) + # ipfs --timeout=6s ls /ipns/$station + TEST=$(~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" stars -p $liking_me | jq -r '.yours.level') + if [ ! $TEST == 'null' ]; then + echo "$station is my friend" + ipfs --timeout=6s cat /ipns/$station/.$station/_xbian.zuid + [ ! $? == 0 ] && echo "UNAVAILABLE FRIEND $liking_me" + sleep 1 + fi +done