Improvments...
This commit is contained in:
parent
507fd996ad
commit
23ef3b516c
|
@ -25,14 +25,14 @@ fi
|
||||||
echo "[" > $FILE
|
echo "[" > $FILE
|
||||||
|
|
||||||
for i in $DATA_MBR; do
|
for i in $DATA_MBR; do
|
||||||
result=$(jaklis get -p $i)
|
result=$($JAKLIS get -p $i)
|
||||||
geoPoint=$(echo "$result" | jq .geoPoint 2>/dev/null)
|
geoPoint=$(echo "$result" | jq .geoPoint 2>/dev/null)
|
||||||
|
|
||||||
if [[ "$geoPoint" == "null" || "$result" == "Profile vide" ]]; then
|
if [[ "$geoPoint" == "null" || "$result" == "Profile vide" ]]; then
|
||||||
continue
|
continue
|
||||||
else
|
else
|
||||||
isMbr='"isMember": true,'
|
isMbr='"isMember": true,'
|
||||||
userId=$(jaklis id -p $i | jq .idty.username)
|
userId=$($JAKLIS id -p $i | jq .idty.username)
|
||||||
userIdFormat="\"userId\": $userId,"
|
userIdFormat="\"userId\": $userId,"
|
||||||
resultWithMbr=$(echo "$result" | sed "s/\"geoPoint\": {/$userIdFormat $isMbr \"geoPoint\": {/g")
|
resultWithMbr=$(echo "$result" | sed "s/\"geoPoint\": {/$userIdFormat $isMbr \"geoPoint\": {/g")
|
||||||
echo "$resultWithMbr," >> $FILE
|
echo "$resultWithMbr," >> $FILE
|
||||||
|
@ -40,7 +40,7 @@ for i in $DATA_MBR; do
|
||||||
done
|
done
|
||||||
|
|
||||||
for i in $DATA_LARF; do
|
for i in $DATA_LARF; do
|
||||||
result=$(jaklis get -p $i)
|
result=$($JAKLIS get -p $i)
|
||||||
geoPoint=$(echo "$result" | jq .geoPoint 2>/dev/null)
|
geoPoint=$(echo "$result" | jq .geoPoint 2>/dev/null)
|
||||||
|
|
||||||
if [[ "$geoPoint" == "null" || "$result" == "Profile vide" ]]; then
|
if [[ "$geoPoint" == "null" || "$result" == "Profile vide" ]]; then
|
||||||
|
@ -56,6 +56,11 @@ sed -i '$ d' $FILE
|
||||||
echo "}" >> $FILE
|
echo "}" >> $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
|
||||||
|
|
|
@ -20,7 +20,9 @@ work() {
|
||||||
unset k
|
unset k
|
||||||
|
|
||||||
balance=$(echo "$jsonResult" | jq -r '.balance')
|
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)
|
formatedBalance=$(printf "%-10s | %-45s | %-1s" $balance $i $username)
|
||||||
|
|
||||||
if [[ $1 == "members" ]]; then
|
if [[ $1 == "members" ]]; then
|
||||||
|
@ -34,6 +36,7 @@ work() {
|
||||||
echo "$formatedBalance" | tee -a /tmp/balance-g1.txt
|
echo "$formatedBalance" | tee -a /tmp/balance-g1.txt
|
||||||
|
|
||||||
totalBalance="$totalBalance"$'\n'"$formatedBalance"
|
totalBalance="$totalBalance"$'\n'"$formatedBalance"
|
||||||
|
echo "$jsonResult" >> /home/poka/debugJsonForbes.log
|
||||||
|
|
||||||
# For tests only
|
# For tests only
|
||||||
# [[ $i == "13fn6X3XWVgshHTgS8beZMo9XiyScx6MB6yPsBB5ZBia" ]] && break
|
# [[ $i == "13fn6X3XWVgshHTgS8beZMo9XiyScx6MB6yPsBB5ZBia" ]] && break
|
||||||
|
|
|
@ -17,8 +17,7 @@
|
||||||
| <a href="/data/wallets-g1.txt">Liste de tous les wallets</a>
|
| <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-membres.txt">Liste des wallets membres</a>
|
||||||
| <a href="/data/wallets-g1-simple.txt">Liste des simples portefeuilles</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/geoloc-members.json">Voir le JSON profiles membres</a> |
|
||||||
| <a href="/data/wallets_balance.html">Classement FORBES</a> |
|
|
||||||
</center>
|
</center>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue