cesium avatar geopoint ssb message type INIT

This commit is contained in:
qo-op 2020-04-28 03:50:48 +02:00
parent 43e3fd5b75
commit 1e9cc0840b
2 changed files with 25 additions and 8 deletions

View File

@ -11,9 +11,9 @@ ME="${0##*/}"
ipfsnodeid=$(/usr/local/bin/ipfs id -f='<id>\n')
g1pub=$(cat ~/.ssb/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
# TIME
minute=$(date +%M)
heure=$(date +%H)
# UNIVERSAL TIME (TODO ntpdate, but sudo problem)
minute=$(date -u +%M)
heure=$(date -u +%H)
timebar="$heure:$minute"
jourdelasemaine=$(date +%w)
jourdumois=$(date +%d)

View File

@ -47,15 +47,32 @@ g1pub=$(cat ~/.ssb/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
# IPFS LOCAL REPOSITORY for Node Identity G1 + SSB
mkdir -p ~/.zen/ipfs/.$ipfsnodeid/G1SSB
# PUBLISH ipfs informations
sbotc publish '{"type":"ipfsnodeid","text":"'"$ipfsnodeid"'"}'
sbotc publish '{"type":"ipfstryme","text":"'"$(ipfs id | jq -r .Addresses[] | tail -n 1)"'"}'
# ADD Cesium+ informations
# GET CESIUM+ geoPoint DATA (TODO install , load balance CesiumPod?)
CESIUM="https://g1.data.le-sou.org"
geopointlat=$(curl -s ${CESIUM}/user/profile/${g1pub} | jq '._source.geoPoint.lat')
[[ $geopointlat != null ]] && sbotc publish '{"type":"cesium_geoPoint.lat","text":"'"$geopointlat"'"}'
geopointlon=$(curl -s ${CESIUM}/user/profile/${g1pub} | jq '._source.geoPoint.lon')
[[ $geopointlon != null ]] && sbotc publish '{"type":"cesium_geoPoint.lon","text":"'"$geopointlon"'"}'
# GET Cesium+ Avatar image
curl -s ${CESIUM}/user/profile/${g1pub} | jq '._source.avatar._content' | sed 's/\"//g' | base64 -d > "/tmp/avatar.png"
## PUBLISH ABOUT MESSAGE
##############################################
# IMAGE of G1 wallet QRCode
qrcodefile=~/.zen/ipfs/.$ipfsnodeid/G1SSB/_g1.qrcode.png
qrencode -s 5 -o $qrcodefile "$g1pub"
# IF AVATAR not png take IMAGE of G1 wallet QRCode
if [[ ! $(file "/tmp/avatar.png" | grep 'PNG') ]]; then
qrcodefile=~/.zen/ipfs/.$ipfsnodeid/G1SSB/_g1.qrcode.png
qrencode -s 5 -o $qrcodefile "$g1pub"
else
qrcodefile=/tmp/avatar.png
fi
# Prepare QRCode File for SSB
name=${qrcodefile##*/}
id="$(sbotc blobs.add < $qrcodefile)"
@ -84,7 +101,7 @@ $g1pub
-- sbotc publish --
"
sbotc publish '{"type":"post","text":"[G1SSB_Wallet.png]('"$id"')\nUse https://cesium.app to send payment.\nComment your transaction with '"'Zen'"' to order ZenTag...","mentions":[{"link":"'"$id"'","name":"'"$name"'","size":'"$size"',"type":"'"$type"'"}]}'
sbotc publish '{"type":"post","text":"[G1SSB_Wallet.png]('"$id"')\nUse https://cesium.app to send payment.\nComment your transaction with '"'Zen'"' to make ZenTag...","mentions":[{"link":"'"$id"'","name":"'"$name"'","size":'"$size"',"type":"'"$type"'"}]}'
echo "