send jacklis "ipfstryme" message to my friends only if tryme.addr file changed
This commit is contained in:
parent
c4a6080d9b
commit
597e4a59cf
|
@ -51,7 +51,7 @@ title=$(curl -s ${GCHANGE}/user/profile/${G1PUB} | jq -r '._source.title')
|
||||||
[[ $title ]] && echo "$title" > ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_name
|
[[ $title ]] && echo "$title" > ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_name
|
||||||
|
|
||||||
[[ $uidna ]] && [[ "$title" == "null" ]] && title="Station $uidna"
|
[[ $uidna ]] && [[ "$title" == "null" ]] && title="Station $uidna"
|
||||||
[[ "$title" == "null" ]] && title="Station $USER@$(cat /etc/hostname)"
|
[[ "$title" == "null" ]] && title="Station $USER@$(hostname)"
|
||||||
|
|
||||||
city=$(curl -s ${GCHANGE}/user/profile/${G1PUB} | jq -r '._source.city')
|
city=$(curl -s ${GCHANGE}/user/profile/${G1PUB} | jq -r '._source.city')
|
||||||
[[ "$city" != "null" ]] && title="$title in $city"
|
[[ "$city" != "null" ]] && title="$title in $city"
|
||||||
|
@ -63,7 +63,7 @@ geopointlat=$(curl -s ${GCHANGE}/user/profile/${G1PUB} | jq '._source.geoPoint.l
|
||||||
geopointlon=$(curl -s ${GCHANGE}/user/profile/${G1PUB} | jq '._source.geoPoint.lon')
|
geopointlon=$(curl -s ${GCHANGE}/user/profile/${G1PUB} | jq '._source.geoPoint.lon')
|
||||||
|
|
||||||
# REFRESH Cesium+ Avatar image
|
# REFRESH Cesium+ Avatar image
|
||||||
curl -s ${GCHANGE}/user/profile/${G1PUB} | jq -r '._source.avatar._content' | base64 -d > "/tmp/_gchange.avatar.png"
|
curl -s ${GCHANGE}/user/profile/${G1PUB} | jq -r '._source.avatar._content' | base64 -d > "/home/$YOU/.zen/ipfs/.$IPFSNODEID/G1SSB/_g1.gchange_avatar.png"
|
||||||
|
|
||||||
# Get nodename
|
# Get nodename
|
||||||
[[ -f /home/$YOU/.zen/ipfs/.$IPFSNODEID/G1SSB/_nodename ]] && nodename=$(cat /home/$YOU/.zen/ipfs/.$IPFSNODEID/G1SSB/_nodename)
|
[[ -f /home/$YOU/.zen/ipfs/.$IPFSNODEID/G1SSB/_nodename ]] && nodename=$(cat /home/$YOU/.zen/ipfs/.$IPFSNODEID/G1SSB/_nodename)
|
||||||
|
@ -99,39 +99,43 @@ IWALLETS=$(ipfs add -rHq ~/.zen/ipfs | tail -n 1)
|
||||||
NODEIPNS=$(ipfs name publish --allow-offline --quieter /ipfs/$IWALLETS)
|
NODEIPNS=$(ipfs name publish --allow-offline --quieter /ipfs/$IWALLETS)
|
||||||
|
|
||||||
###
|
###
|
||||||
# GET ALL MY GCHANGE FRIENDS AND SEND THEM my IPFS Address
|
#### FRIENDS && BOOTSTRAP ipfstryme MESSAGE sending procedure
|
||||||
########################################################################
|
########################################################################
|
||||||
# GET LIST of issuer(s) who likes me
|
# GET LIST of issuer(s) who likes me
|
||||||
for liking_me in $(~/.zen/astrXbian/zen/jaklis/jaklis.py like | jq -r '.likes[].issuer');
|
for liking_me in $(~/.zen/astrXbian/zen/jaklis/jaklis.py like | jq -r '.likes[].issuer' && cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#");
|
||||||
do
|
do
|
||||||
# CHECk if I am liking him either
|
# BOOTSTRAP AUTO LIKE BACK
|
||||||
friend_of_mine=$(~/.zen/astrXbian/zen/jaklis/jaklis.py like -p $liking_me | jq -r '.yours');
|
isG1PUBoot=$(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep "$G1PUB") # AM I A BOOTSTRAP ?
|
||||||
echo "Sending IPFSTRYME message to $liking_me"
|
|
||||||
[[ $friend_of_mine != null ]] && ~/.zen/astrXbian/zen/jaklis/jaklis.py send -d $liking_me -t "ipfstryme" -f ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr
|
|
||||||
sleep 3 # SLOW DOWN
|
|
||||||
done
|
|
||||||
|
|
||||||
echo 'SEND ipfstryme to A_boostrap_nodes.txt listed PUBs' # Add your bootstrap Pub here
|
|
||||||
for g1node in $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#") # remove comments
|
|
||||||
do
|
|
||||||
if [[ $g1node != "" ]]; then
|
|
||||||
echo "LIKING my BOOTSTRAP node : $g1node"
|
|
||||||
# ~/.zen/astrXbian/zen/jaklis/jaklis.py -n "https://g1.data.le-sou.org" send -d $g1node -t "ipfstryme" -f ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr
|
|
||||||
~/.zen/astrXbian/zen/jaklis/jaklis.py send -d $g1node -t "ipfstryme" -f ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr
|
|
||||||
/home/$YOU/.zen/astrXbian/zen/jaklis/jaklis.py unlike -p $g1node
|
|
||||||
/home/$YOU/.zen/astrXbian/zen/jaklis/jaklis.py like -p $g1node -s 3
|
|
||||||
|
|
||||||
isG1PUBoot=$(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep "$G1PUB") # search my G1PUB ?
|
|
||||||
if [[ $isG1PUBoot == "$G1PUB" ]]; then
|
if [[ $isG1PUBoot == "$G1PUB" ]]; then
|
||||||
for liking_me in $(/home/$YOU/.zen/astrXbian/zen/jaklis/jaklis.py like | jq -r '.likes[].issuer')
|
for liking_me in $(/home/$YOU/.zen/astrXbian/zen/jaklis/jaklis.py like | jq -r '.likes[].issuer')
|
||||||
do
|
do
|
||||||
echo "SENDING 3 STARS to $liking_me"
|
echo "I AM A BOOTSTRAP $G1PUB"
|
||||||
|
echo "SENDING 1 STAR ATUTO LIKE to $liking_me"
|
||||||
/home/$YOU/.zen/astrXbian/zen/jaklis/jaklis.py unlike -p $liking_me
|
/home/$YOU/.zen/astrXbian/zen/jaklis/jaklis.py unlike -p $liking_me
|
||||||
/home/$YOU/.zen/astrXbian/zen/jaklis/jaklis.py like -p $liking_me -s 3
|
/home/$YOU/.zen/astrXbian/zen/jaklis/jaklis.py like -p $liking_me -s 1
|
||||||
|
sleep 1 # SLOW DOWN
|
||||||
done
|
done
|
||||||
#$(cat ~/.zen/ipfs_swarm/xbian/_*) # ACTIVATE AUTO FULL RESTORE
|
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
# CHECk if I am liking him either
|
||||||
|
friend_of_mine=$(~/.zen/astrXbian/zen/jaklis/jaklis.py like -p $liking_me | jq -r '.yours');
|
||||||
|
if [[ $friend_of_mine != null ]]
|
||||||
|
then
|
||||||
|
# ADD $liking_me TO MY ipfs FRIENDS list
|
||||||
|
mkdir -p ~/.zen/ipfs/.${IPFSNODEID}/FRIENDS/$liking_me
|
||||||
|
# SEND jaklis message if tryme.addr is different from last one
|
||||||
|
if [[ $(diff ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr ~/.zen/ipfs/.${IPFSNODEID}/FRIENDS/$liking_me/tryme.addr) ]]
|
||||||
|
then
|
||||||
|
echo "I AM $G1PUB"
|
||||||
|
echo "Sending IPFSTRYME message to $liking_me"
|
||||||
|
~/.zen/astrXbian/zen/jaklis/jaklis.py send -d $liking_me -t "ipfstryme" -f ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr
|
||||||
|
else
|
||||||
|
echo "tryme.addr MESSAGE ALREADY SEND TO $liking_me"
|
||||||
|
fi
|
||||||
|
# MEMORIZE actual tryme.addr
|
||||||
|
cp -f ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr ~/.zen/ipfs/.${IPFSNODEID}/FRIENDS/$liking_me/
|
||||||
|
fi
|
||||||
|
sleep 1 # SLOW DOWN
|
||||||
done
|
done
|
||||||
|
|
||||||
# RESTORE Vstream astroport.py source (in case Vstream plugin was updated)
|
# RESTORE Vstream astroport.py source (in case Vstream plugin was updated)
|
||||||
|
|
Loading…
Reference in New Issue