cesium avatar geopoint ssb message type INIT
This commit is contained in:
parent
43e3fd5b75
commit
1e9cc0840b
|
@ -11,9 +11,9 @@ ME="${0##*/}"
|
||||||
ipfsnodeid=$(/usr/local/bin/ipfs id -f='<id>\n')
|
ipfsnodeid=$(/usr/local/bin/ipfs id -f='<id>\n')
|
||||||
g1pub=$(cat ~/.ssb/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
|
g1pub=$(cat ~/.ssb/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
|
||||||
|
|
||||||
# TIME
|
# UNIVERSAL TIME (TODO ntpdate, but sudo problem)
|
||||||
minute=$(date +%M)
|
minute=$(date -u +%M)
|
||||||
heure=$(date +%H)
|
heure=$(date -u +%H)
|
||||||
timebar="$heure:$minute"
|
timebar="$heure:$minute"
|
||||||
jourdelasemaine=$(date +%w)
|
jourdelasemaine=$(date +%w)
|
||||||
jourdumois=$(date +%d)
|
jourdumois=$(date +%d)
|
||||||
|
|
|
@ -47,15 +47,32 @@ g1pub=$(cat ~/.ssb/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
|
||||||
|
|
||||||
# IPFS LOCAL REPOSITORY for Node Identity G1 + SSB
|
# IPFS LOCAL REPOSITORY for Node Identity G1 + SSB
|
||||||
mkdir -p ~/.zen/ipfs/.$ipfsnodeid/G1SSB
|
mkdir -p ~/.zen/ipfs/.$ipfsnodeid/G1SSB
|
||||||
|
|
||||||
|
# PUBLISH ipfs informations
|
||||||
sbotc publish '{"type":"ipfsnodeid","text":"'"$ipfsnodeid"'"}'
|
sbotc publish '{"type":"ipfsnodeid","text":"'"$ipfsnodeid"'"}'
|
||||||
sbotc publish '{"type":"ipfstryme","text":"'"$(ipfs id | jq -r .Addresses[] | tail -n 1)"'"}'
|
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
|
## PUBLISH ABOUT MESSAGE
|
||||||
##############################################
|
##############################################
|
||||||
# IMAGE of G1 wallet QRCode
|
# IF AVATAR not png take IMAGE of G1 wallet QRCode
|
||||||
qrcodefile=~/.zen/ipfs/.$ipfsnodeid/G1SSB/_g1.qrcode.png
|
if [[ ! $(file "/tmp/avatar.png" | grep 'PNG') ]]; then
|
||||||
qrencode -s 5 -o $qrcodefile "$g1pub"
|
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
|
# Prepare QRCode File for SSB
|
||||||
name=${qrcodefile##*/}
|
name=${qrcodefile##*/}
|
||||||
id="$(sbotc blobs.add < $qrcodefile)"
|
id="$(sbotc blobs.add < $qrcodefile)"
|
||||||
|
@ -84,7 +101,7 @@ $g1pub
|
||||||
|
|
||||||
-- sbotc publish --
|
-- 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 "
|
echo "
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue