hello im trying to make a weather widget, but i can't find the proper way to parse the weather.com xml web page here is what i got so far Code: wget -t 1 -T10 -q http://xml.weather.com/weather/local/ARBA1708?cc=*&unit=M&dayf=0 | awk '/<icon>/,/<\/icon>/{print $1}' i don't know too much about awk, but what im trying to parse is the number of the icon, so it can be result as an exit and displayed from a set of icons (just like omweather does) the problem is i'm not getting any output, just exit=0 and no result can anyone help me to get the correct format or tell me if i'm missing something?
wget -t 1 -T10 -q http://xml.weather.com/weather/local/ARBA1708?cc=*&unit=M&dayf=0 | awk '/<icon>/,/<\/icon>/{print $1}'
Nokia-N900-51-1:~# wget -t 1 -T 10 -O - -q 'http://xml.weather.com/weather/local/ARBA1708?cc=*&unit=M&dayf=0' | awk 'BEGIN {FS="[\<\>]";}/<icon>/,/<\/icon>/{print $3}' | head -1 34 Nokia-N900-51-1:~# wget -t 1 -T 10 -O - -q 'http://xml.weather.com/weather/local/ARBA1708?cc=*&unit=M&dayf=0' | awk 'BEGIN {FS="[\<\>]";}/<icon>/,/<\/icon>/{print $3}' | tail -1 11 Nokia-N900-51-1:~#