This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[[ "$TRACE" ]] && set -x | |
get_data() { | |
local mesure="$1" | |
local day="now" | |
curl --silent "http://data.airbreizh.asso.fr/geoserver/airbreizh_mes_bretagne_horaire_poll_princ/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=mes_bretagne_horaire_:mes_bretagne_horaire_$mesure&outputFormat=application%2Fjson&CQL_FILTER=date_debut%20like%20%27$(date -d"$day" +%d%%2f%m%%2f%Y)%25%27" | jq --raw-output --arg mesure $mesure '.features[] | select(.properties.valeur != null) | "airbreizh."+.properties.code_station+"."+ $mesure +" "+(.properties.valeur|tostring)+" "+(.properties.date_debut|strptime("%d/%m/%Y %H:%M") | mktime | tostring)' | nc -q0 localhost 2003 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
curl http://www.meteo-france.mobi/ws/getDetail/france/462010.json \ | |
| | jq '.result.previsions | map(.)[] | select(.jour<3) | select( .moment=="matin" or .moment=="midi" or .moment=="soir") | {"date": .date, "jour": .jour, "moment": .moment, "description": .description, "vent": {"direction": .directionVent, "vitesse": .vitesseVent, "rafales": .forceRafales}, "temperatures": {"min": .temperatureMin, "max": .temperatureMax}, "indiceUV": .indiceUV, "probaPluie": .probaPluie }' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
city="$1" | |
curl --silent "http://api.openweathermap.org/data/2.5/weather?q=$city&units=metric" \ | |
| jq --argfile wind ~/.config/wind.json \ | |
'{"city": .name, "updated": .dt, "sunrise": .sys.sunrise, "sunset":.sys.sunset, "temperature": .main.temp, "wind": {"speed": (.wind.speed*3.6|floor), "direction": $wind[((.wind.deg+11.25)/22.5)|floor]}}' \ | |
| sed -r 's/(.*:) ([0-9]{10,}),/echo -n "\1: " ; date "+%Y-%m-%d %H:%M:%S" -d"@\2"/e' \ | |
> $city.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# © 2015 Flyinva | |
# https://github.com/flyinva https://twitter.com/flyinva | |
# License WTFPL | |
# | |
function get_json_cities_pluie { | |
city="$1" | |
wget --quiet --output-document=- \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exiftool -n -g -json \ | |
-imagewidth \ | |
-imageheight \ | |
-composite:gpslatitude \ | |
-composite:gpslongitude \ | |
*jpg \ | |
| jq --compact-output --arg urlBase http://mysite.net/myphotos/ \ | |
'{ | |
"type": "FeatureCollection", | |
"features": |