#!/bin/bash

BASE=/home/cschwede/public_html/weather_micky2

AKT_WEATHER=`$BASE/rss_wetter.py |head -n 1 - | sed -e 's/°/_/g'`
TDY_WEATHER=`$BASE/rss_wetter.py |tail -n 1 - | sed -e 's/°/_/g'`

echo $AKT_WEATHER | cut -d " " -f3|cut -d "_" -f 1 >$BASE/temp.txt
echo $AKT_WEATHER | cut -d " " -f5 >$BASE/pressure.txt
echo $AKT_WEATHER | cut -d " " -f8 >$BASE/wind.txt
echo $AKT_WEATHER | cut -d " " -f11|cut -d "_" -f 1 >$BASE/winddir.txt
echo $AKT_WEATHER | cut -d " " -f14 >$BASE/rainrate.txt

echo $TDY_WEATHER | cut -d " " -f4|cut -d "_" -f 1 >$BASE/temp_min.txt
echo $TDY_WEATHER | cut -d " " -f10|cut -d "_" -f 1 >$BASE/temp_max.txt
echo $TDY_WEATHER | cut -d " " -f27 >$BASE/pressure_min.txt
echo $TDY_WEATHER | cut -d " " -f33 >$BASE/pressure_max.txt
echo $TDY_WEATHER | cut -d " " -f40 >$BASE/wind_max.txt
echo $TDY_WEATHER | cut -d " " -f43|cut -d "_" -f 1 >$BASE/winddir_max.txt
echo $TDY_WEATHER | cut -d " " -f48 >$BASE/rainsum_day.txt


