Add JSON generation for Cs+ profiles with geoloc

This commit is contained in:
poka 2021-03-30 14:32:21 +02:00
parent 542fd94012
commit 52c94e9f4d
2 changed files with 34 additions and 1 deletions

32
scripts/geoloc-members-json.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
# Récupération du chemin absolut du répertoir du script actuel
GPATH="$( cd "$(dirname "$0")" ; pwd -P )/.."
[[ ! -f $GPATH/.env ]] && cp $GPATH/.env.example $GPATH/.env
source $GPATH/.env
SOURCE="https://g1-stats.axiom-team.fr/data/wallets-g1-membres.txt"
FILE="/tmp/geoloc-members.json"
FINAL_LOCATION="$WEBPATH/data"
echo "[" > $FILE
for i in $(curl -s $SOURCE); do
result=$(jaklis get -p $i)
geoPoint=$(echo "$result" | jq .geoPoint 2>/dev/null)
if [[ "$geoPoint" == "null" || "$result" == "Profile vide" ]]; then
continue
else
echo "$result," >> $FILE
fi
done
sed -i '$ d' $FILE
echo "}" >> $FILE
echo "]" >> $FILE
mv $FILE $FINAL_LOCATION

View File

@ -13,10 +13,11 @@
<div class="header"> <div class="header">
<center><h1>Ḡ1 Stats</h1> <center><h1>Ḡ1 Stats</h1>
| <a href="/data/daily.json">Voir le fichier JSON</a> | <a href="/data/daily.json">Voir le JSON g1stats</a>
| <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/wallets_balance.html">Classement FORBES</a> | | <a href="/data/wallets_balance.html">Classement FORBES</a> |
</center> </center>
</div> </div>