You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

19 lines
800 B

#!/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