On Friday 08 January 2021 10:57:32 am deloptes via tde-users wrote: > Stefan Krusche via tde-users wrote: > >> What do you think? > > > > Great! Sounds like cooperation. What else can we expect from each other > > or this community! > > I think I found the source of stations.dat. What could be useful is a > mapping of countries to regions. Then weather_stations.desktop could be > generated automatically out of stations.dat. I admit I've only been skiming this thread, I tried kweather once, it didn't have my nearest airport, nor could I figure out how to manually enter my airport's code ID, so it wasn't really useful. That said... Q1: Isn't there already an 'official' mapping of countries to regions? I know I've used this data on other people's websites (and Timezone data kinda does this as well), so I'd bet there is some goverment function somewhere that already maps it to pull from. Q2: Wouldn't it be better to have kweather itself auto-generate stations real time off of noaa? That'd at least solve the "can't find my known airport." Or at least a way to manually enter an airports code ID? Alternative 1: Would it be feasable to pull from wunderground.com (at least by manually entering station names)? Last summer I needed average temps around me for an attic fan setup and used data from wunderground. See attached. It's not pretty, but it worked well enough.. Okay, bowing out, best, Michael
#!/bin/bash # # # Description # Grap 4 weather stations' data # # */15 * * * * /home/michael/common/bin/attictemps # # Script=attictemps # Author=Michael # Email=use website contact # Website=http://www.inet-design.com/ # License=GPL # Script repository=none # # # # # # # # # Be Nice renice -n 15 -p $$ >/dev/null 2>/dev/null # # # # # Include Standard Paths & Functions IncFile="$(dirname "${BASH_SOURCE[0]}")/includes/stdpaths.sh" if [ -f "$IncFile" ] ; then . "$IncFile" else echo 'No Standard Paths! Exiting' exit 1 fi IncFile="$(dirname "${BASH_SOURCE[0]}")/includes/stdfunctions.sh" if [ -f "$IncFile" ] ; then . "$IncFile" fi # # # # # Static Setups # Random user aget UserAgent=`randomUserAgent` # # # # cd "/home/michael/data/trash/attictemps" StationNames=( KTNMURFR95 KTNMURFR26 KTNMURFR129 KTNMURFR72 ) DateTime=`date +"%Y%m%d%H%M"` echo -n "$DateTime" >> attictemps.csv for StationName in "${StationNames[@]}"; do echo "$StationName.$DateTime" wget \ --user-agent="$UserAgent" \ --passive-ftp \ --execute robots=off \ --output-document="$StationName.$DateTime" \ --append-output wget-attictemps.log \ "https://www.wunderground.com/dashboard/pws/$StationName" temp=`grep '&q;temp&q;:' "$StationName.$DateTime" | sed 's/.*\&q;temp\&q;:\(.*\),\&q;heatIndex\&q.*/\1/'` echo -n ",$temp" >> attictemps.csv rm "$StationName.$DateTime" 2>/dev/null done echo "" >> attictemps.csv
____________________________________________________ tde-users mailing list -- users@xxxxxxxxxxxxxxxxxx To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxx Web mail archive available at https://mail.trinitydesktop.org/mailman3/hyperkitty/list/users@xxxxxxxxxxxxxxxxxx