View Single Post
No!No!No!Yes!'s Avatar
Posts: 700 | Thanked: 846 times | Joined on Nov 2009
#1230
Originally Posted by Harick View Post
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?
PHP Code:
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:~
__________________
Have a look at Queen BeeCon Widget (WIKI) Customizable and flexible widget-based multi-instance monitoring, alerting and interactive tool for the N900
Please provide comments and feedback for having QBW supported and enhanced further - (DONATE) - v1.3.3devel / v1.3.3testing / v1.3.3extras
 

The Following User Says Thank You to No!No!No!Yes! For This Useful Post: