Date: _day - _heure
Noeud scanné: https://duniter-g1.p2p.legal
@@ -19,11 +20,11 @@ Nombre total de wallet: _nbrTotalWallets
Nombre de membres: _nbrMembers (_pourcentMbrs%)
Nombre de simple portefeuille: _nbrSimpleWallets (_pourcentWallets%)
---
-Reçus simples portefeuille: _txInSimple Ḡ1 Voir le graphique
+Reçus simples portefeuille: _txInSimple Ḡ1 Voir le graphique
Envoyé simples portefeuille: _txOutSimple Ḡ1
Soldes simples portefeuille: _soldeSimple Ḡ1 (_pourcentSimpleWallet% de la masse monétaire totale)
---
-Reçus membres: _txInMembers Ḡ1 (sans les DU)
+Reçus membres: _txInMembers Ḡ1 (sans les DU) Voir le graphique
Envoyé membres: _txOutMembers Ḡ1
Soldes membres: _soldeMembers Ḡ1 (sans les DU)
---
diff --git a/tpl/mixed.html b/tpl/mixed.html
new file mode 100644
index 0000000..b38f501
--- /dev/null
+++ b/tpl/mixed.html
@@ -0,0 +1,145 @@
+
+
+
+
+
+
+
+
+
+
+
+
+Graphiques
+
+
Ḡ1 reçus sur les wallets
+
+
+
+
Nombre de wallets
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tpl/nbr_wallets.html b/tpl/nbr_wallets.html
new file mode 100644
index 0000000..ea10f3e
--- /dev/null
+++ b/tpl/nbr_wallets.html
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tpl/nbr_wallets.json b/tpl/nbr_wallets.json
new file mode 100644
index 0000000..1d69b11
--- /dev/null
+++ b/tpl/nbr_wallets.json
@@ -0,0 +1 @@
+ {\n \"date\": \"_DATE\",\n \"nbrWallets\": \"_NBRWALLETS\",\n \"nbrMembres\": \"_NBRMEMBRES\"\n },
diff --git a/tpl/recus.html b/tpl/recus.html
new file mode 100644
index 0000000..911517a
--- /dev/null
+++ b/tpl/recus.html
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tpl/recus.json b/tpl/recus.json
new file mode 100644
index 0000000..c80a393
--- /dev/null
+++ b/tpl/recus.json
@@ -0,0 +1 @@
+ {\n \"date\": \"_DATE\",\n \"rWallets\": \"_RWALLETS\",\n \"rMembres\": \"_RMEMBRES\"\n },
diff --git a/transform_json.sh b/transform_json.sh
index 2a16cb3..edc5f82 100755
--- a/transform_json.sh
+++ b/transform_json.sh
@@ -6,18 +6,53 @@ n=2 # Nombre de jours pour les pas en abscisse
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
if [[ -e $SCRIPTPATH/.env ]]; then source $SCRIPTPATH/.env; else echo "Veuillez créer votre fichier .env inspiré de .env.example" && exit 1; fi
-rWallets=$(grep -E "Date:|Reçus simples wallets|Reçus simples portefeuille" $WEBPATH/history/index_*.html | awk -F '' '{ print $2 }' | awk '{ print $1 }' | tr -d '.' | tr ',' '.')
-j=1
+## Ḡ1 reçus
+rWallets() {
+rWallets=$(grep -E "Date:|Reçus simples wallets|Reçus simples portefeuille|Reçus membres" $WEBPATH/history/index_*.html | awk -F '' '{ print $2 }' | awk '{ print $1 }' | tr -d '.' | tr ',' '.')
+rWallets=$(sed '/-/i !' <<< $rWallets)
+
+local j=0
+local IFS=$'!'
for i in $rWallets; do
- ! [[ $j =~ ^(0|1)$ ]] && ((j--))
- if [[ $j == 1 ]]; then
- jsonTPL=$(sed s/_DATE/$i/g tpl/graph.json)
- j=0
- elif [[ $j == 0 ]]; then
- result+=$(sed s/_RWALLET/$i/g <<< $jsonTPL)
- [[ $n == 1 ]] && j=1 || j=$((n*2))
- fi
+ ((j++))
+ [[ $j == 1 || ! $(( $j % $n )) == 0 ]] && continue
+ local dateN=$(sed '2q;d' <<< $i)
+ local RW=$(sed '3q;d' <<< $i)
+ local RM=$(sed '4q;d' <<< $i)
+
+ local jsonTPL=$(sed s/_DATE/$dateN/g $SCRIPTPATH/tpl/recus.json)
+ local jsonTPL=$(sed s/_RWALLETS/$RW/g <<< $jsonTPL)
+ local result+=$(sed s/_RMEMBRES/$RM/g <<< $jsonTPL)
done
-sed "s/_JSONDATA/$result/g" $SCRIPTPATH/tpl/graph.html > $WEBPATH/graph.html
+sed "s/_JSONDATA/$result/g" $SCRIPTPATH/tpl/recus.html > $WEBPATH/graph/recus.html
+sed "s/_JSONDATARW/$result/g" $SCRIPTPATH/tpl/mixed.html > $WEBPATH/graph/mixed.html
+}
+
+nbrWallets() {
+## Nombre de wallets
+nbrWallets=$(grep -E "Date:|Nombre de membres|Nombre de simple portefeuille" $WEBPATH/history/index_*.html | awk -F '' '{ print $2 }' | awk -F '' '{ print $1 }' | awk '{ print $1 }')
+nbrWallets=$(sed '/-/i !' <<< $nbrWallets)
+
+local j=0
+local IFS=$'!'
+for i in $nbrWallets; do
+ ((j++))
+ [[ $j == 1 || ! $(( $j % $n )) == 0 ]] && continue
+ local dateN=$(sed '2q;d' <<< $i)
+ local NBRM=$(sed '3q;d' <<< $i)
+ local NBRW=$(sed '4q;d' <<< $i)
+
+ local jsonTPL=$(sed s/_DATE/$dateN/g $SCRIPTPATH/tpl/nbr_wallets.json)
+ local jsonTPL=$(sed s/_NBRWALLETS/$NBRW/g <<< $jsonTPL)
+ local result+=$(sed s/_NBRMEMBRES/$NBRM/g <<< $jsonTPL)
+done
+
+sed "s/_JSONDATA/$result/g" $SCRIPTPATH/tpl/nbr_wallets.html > $WEBPATH/graph/nbr_wallets.html
+sed -i "s/_JSONDATANBRW/$result/g" $WEBPATH/graph/mixed.html
+
+}
+
+rWallets
+nbrWallets