+++ ~/.zen/tmp/${IPFSNODEID}/weather.txt +++
This commit is contained in:
parent
066710056b
commit
ea7ba67add
|
@ -102,18 +102,8 @@ if [[ ${QRCODE} == "station" ]]; then
|
||||||
ISTATION=$(cat ~/.zen/tmp/ISTATION)
|
ISTATION=$(cat ~/.zen/tmp/ISTATION)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## GET SATELLITE IMAGE
|
## LOG IPFSNODEID : IPCity + Wheater + more...
|
||||||
source ~/.zen/GPS
|
${MY_PATH}/../tools/IPFSNODEID.weather.sh > ~/.zen/tmp/${IPFSNODEID}/weather.txt
|
||||||
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"
|
|
||||||
|
|
||||||
## SHOW ZenStation FRONT
|
## SHOW ZenStation FRONT
|
||||||
sed "s~_STATION_~${myIPFS}${ISTATION}/~g" $MY_PATH/../templates/ZenStation/index.html > ~/.zen/tmp/${MOATS}/index.htm
|
sed "s~_STATION_~${myIPFS}${ISTATION}/~g" $MY_PATH/../templates/ZenStation/index.html > ~/.zen/tmp/${MOATS}/index.htm
|
||||||
|
|
|
@ -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 +++
|
|
@ -456,7 +456,7 @@ my_IPCity() {
|
||||||
local ville=$(echo "$geolocalisation" | jq -r '.city')
|
local ville=$(echo "$geolocalisation" | jq -r '.city')
|
||||||
local pays=$(echo "$geolocalisation" | jq -r '.country')
|
local pays=$(echo "$geolocalisation" | jq -r '.country')
|
||||||
|
|
||||||
echo "$ville, $pays"
|
echo "$ville,$pays"
|
||||||
}
|
}
|
||||||
|
|
||||||
IPFSNODEID="$(myIpfsPeerId)"
|
IPFSNODEID="$(myIpfsPeerId)"
|
||||||
|
|
Loading…
Reference in New Issue