Improvments...

This commit is contained in:
poka 2021-06-04 01:40:42 +02:00
parent 507fd996ad
commit 23ef3b516c
3 changed files with 15 additions and 8 deletions

View File

@ -25,14 +25,14 @@ fi
echo "[" > $FILE
for i in $DATA_MBR; do
result=$(jaklis get -p $i)
result=$($JAKLIS get -p $i)
geoPoint=$(echo "$result" | jq .geoPoint 2>/dev/null)
if [[ "$geoPoint" == "null" || "$result" == "Profile vide" ]]; then
continue
else
isMbr='"isMember": true,'
userId=$(jaklis id -p $i | jq .idty.username)
userId=$($JAKLIS id -p $i | jq .idty.username)
userIdFormat="\"userId\": $userId,"
resultWithMbr=$(echo "$result" | sed "s/\"geoPoint\": {/$userIdFormat $isMbr \"geoPoint\": {/g")
echo "$resultWithMbr," >> $FILE
@ -40,7 +40,7 @@ for i in $DATA_MBR; do
done
for i in $DATA_LARF; do
result=$(jaklis get -p $i)
result=$($JAKLIS get -p $i)
geoPoint=$(echo "$result" | jq .geoPoint 2>/dev/null)
if [[ "$geoPoint" == "null" || "$result" == "Profile vide" ]]; then
@ -56,6 +56,11 @@ sed -i '$ d' $FILE
echo "}" >> $FILE
echo "]" >> $FILE
[[ -f $FINAL_LOCATION ]] && cat $FILE | jq . > $FINAL_LOCATION
finalResult=$(cat $FILE | jq .)
RESULT=$?
if [ $RESULT -eq 0 ]; then
echo "$finalResult" > $FINAL_LOCATION
else
echo "Failed" >> $FILE
fi

View File

@ -20,7 +20,9 @@ work() {
unset k
balance=$(echo "$jsonResult" | jq -r '.balance')
username=$(echo "$jsonResult" | jq -r '.username')
[[ $balance == "null" ]] && balance="0"
username=$(echo "$jsonResult" | jq -r '.idty.username')
[[ $username == "null" ]] && username=""
formatedBalance=$(printf "%-10s | %-45s | %-1s" $balance $i $username)
if [[ $1 == "members" ]]; then
@ -34,6 +36,7 @@ work() {
echo "$formatedBalance" | tee -a /tmp/balance-g1.txt
totalBalance="$totalBalance"$'\n'"$formatedBalance"
echo "$jsonResult" >> /home/poka/debugJsonForbes.log
# For tests only
# [[ $i == "13fn6X3XWVgshHTgS8beZMo9XiyScx6MB6yPsBB5ZBia" ]] && break

View File

@ -17,8 +17,7 @@
| <a href="/data/wallets-g1.txt">Liste de tous les wallets</a>
| <a href="/data/wallets-g1-membres.txt">Liste des wallets membres</a>
| <a href="/data/wallets-g1-simple.txt">Liste des simples portefeuilles</a>
| <a href="/data/geoloc-members.json">Voir le JSON profiles membres</a>
| <a href="/data/wallets_balance.html">Classement FORBES</a> |
| <a href="/data/geoloc-members.json">Voir le JSON profiles membres</a> |
</center>
</div>