diff --git a/API/QRCODE.sh b/API/QRCODE.sh index e5004d3f..14d735dd 100755 --- a/API/QRCODE.sh +++ b/API/QRCODE.sh @@ -102,18 +102,8 @@ if [[ ${QRCODE} == "station" ]]; then ISTATION=$(cat ~/.zen/tmp/ISTATION) fi - ## GET SATELLITE IMAGE - source ~/.zen/GPS - echo "... ~/.zen/GPS ... $LAT $LON ..." - ville=$(my_IPCity) - echo "my_IPCity = $ville" - api_key="ac5e65a2fd10d3788d40cdae0d4516ba" # Remplacez YOUR_API_KEY par votre clé API OpenWeatherMap - url="http://api.openweathermap.org/data/2.5/weather?q=$ville&appid=$api_key&units=metric" - meteo=$(curl -s $url) - # Extraire les informations pertinentes de la réponse JSON - temperature=$(echo $meteo | jq -r '.main.temp') - description=$(echo $meteo | jq -r '.weather[0].description') - echo "La météo à $ville : $description, Température: $temperature °C" + ## LOG IPFSNODEID : IPCity + Wheater + more... + ${MY_PATH}/../tools/IPFSNODEID.weather.sh > ~/.zen/tmp/${IPFSNODEID}/weather.txt ## SHOW ZenStation FRONT sed "s~_STATION_~${myIPFS}${ISTATION}/~g" $MY_PATH/../templates/ZenStation/index.html > ~/.zen/tmp/${MOATS}/index.htm diff --git a/tools/IPFSNODEID.weather.sh b/tools/IPFSNODEID.weather.sh new file mode 100755 index 00000000..53ddebaa --- /dev/null +++ b/tools/IPFSNODEID.weather.sh @@ -0,0 +1,27 @@ +#!/bin/bash +######################################################################## +# Version: 0.1 +# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) +######################################################################## +## EXPLORE SWARM MAPNS +MY_PATH="`dirname \"$0\"`" # relative +MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized +ME="${0##*/}" + +. "$MY_PATH/../tools/my.sh" + +## GET IPFSNODEID WHEATER +source ~/.zen/GPS +echo "... ~/.zen/GPS ... $LAT $LON ..." +ville=$(my_IPCity) +echo "my_IPCity = $ville" +api_key="ac5e65a2fd10d3788d40cdae0d4516ba" # Remplacez YOUR_API_KEY par votre clé API OpenWeatherMap +url="http://api.openweathermap.org/data/2.5/weather?q=$ville&APPID=$api_key&units=metric" +meteo=$(curl -s $url) +# Extraire les informations pertinentes de la réponse JSON +temperature=$(echo $meteo | jq -r '.main.temp') +description=$(echo $meteo | jq -r '.weather[0].description') +echo "$ville : $description, ( $temperature °C )" + +## SATELLITE IMAGE ... +## Add more +++ diff --git a/tools/my.sh b/tools/my.sh index 32fefc74..97cf5692 100755 --- a/tools/my.sh +++ b/tools/my.sh @@ -456,7 +456,7 @@ my_IPCity() { local ville=$(echo "$geolocalisation" | jq -r '.city') local pays=$(echo "$geolocalisation" | jq -r '.country') - echo "$ville, $pays" + echo "$ville,$pays" } IPFSNODEID="$(myIpfsPeerId)"