Browse Source

Add JSON generation for Cs+ profiles with geoloc

master
poka 1 month ago
parent
commit
52c94e9f4d
2 changed files with 34 additions and 1 deletions
  1. +32
    -0
      scripts/geoloc-members-json.sh
  2. +2
    -1
      tpl/index.html

+ 32
- 0
scripts/geoloc-members-json.sh 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

+ 2
- 1
tpl/index.html View File

@ -13,10 +13,11 @@
<div class="header">
<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-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> |
</center>
</div>


Loading…
Cancel
Save