From 2425e01801d8dd71f52cba4fa7e027de6a5e454d Mon Sep 17 00:00:00 2001 From: Boris Paing Date: Sun, 15 Mar 2020 02:32:54 +0100 Subject: [PATCH] Temporarilly cancel publishing on user SSB profile --- process-likes-g1tx.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/process-likes-g1tx.sh b/process-likes-g1tx.sh index ed2deb2..1e7797d 100755 --- a/process-likes-g1tx.sh +++ b/process-likes-g1tx.sh @@ -177,12 +177,23 @@ EVERY=1 TIMEBEFORE=$(date --date="-$EVERY minutes" +"%s") TIMESTAMP=$(date +"%s") #log "GETTING last $EVERY mn TX : https://duniter-g1.p2p.legal/tx/history/$g1pub/times/$TIMEBEFORE/$TIMESTAMP" -curl -s https://$duniter_server/tx/history/$g1pub/times/$TIMEBEFORE/$TIMESTAMP | jq '.history.pending' | jq '.[].comment' > /tmp/zenfontain.g1tx.txt +json=$(curl -s https://$duniter_server/tx/history/$g1pub/times/$TIMEBEFORE/$TIMESTAMP) +pending_tx=$(printf %s "$json" | jq '.history.pending') +pending_tx_comments==$(printf %s "$pending_tx" | jq '.[].comment') +printf %s "$pending_tx_comments" > /tmp/zenfontain.g1tx.txt + + while read txincmd do export $txincmd log "$g1pub TX IN PENDING !! COMMENT = " $txincmd - sbotc publish '{"type":"post","text":"I am receiving G1 on my SSB Wallet $g1pub"}' + + # We have to check if [].issuers.0 != $g1pub + # or else it will publish the following message each time we SEND a transaction + + #sbotc publish '{"type":"post","text":"I am receiving G1 on my SSB Wallet $g1pub"}' + + done < /tmp/zenfontain.g1tx.txt