I like having weather report on my screen and being quite big fan of Conky I prefer using it. What I want isn’t that much, all I need it temperature and information about whether it’s sunny or not. Kaivalagi has excellent weather script Conky Forecast, it’s really versatile, but bit big for my needs. I used also a weather script which I found in ArchLinux forums. For some reason I thought it might be good idea try to use rss feed. I happened to see site called rssWeather.com mentioned in CrunchBang Forums. Conky has rss variable, but as far I know it only fetches the title. And while title was fine, it told the relevant information, it also had irrelevant stuff (and it’s ugly and takes space). For example this:
London, UNITED KINGDOM Weather :: 16C Mostly clear
Okey it tells the location, but I have fairly narrow Conky and the most important part was almost cut away… And if the actual content is this:
16C Mostly clear
Of course I rather have that. Finding solution was bit tricky (I’m not a script master ;) ). I found nice rss script for conky UbuntuForums, but I had to tweak it bit though to get it show the content instead of title. I opened feed’s source code and checked what xml tags were surrounding the content (<description>content</description>). After this I simply changed following part of script:
sed -e 's/<\/title>/\n/g' |\
grep -o '<title>.*' |\
sed -e 's/<title>//' |\
to this:
sed -e 's/<\/description>/\n/g' |\
grep -o '<description>.*' |\
sed -e 's/<description>//' |\
So instead of the title I get the content. :D Under are the relevant lines in my conkyrc:
City A : ${execi 3600 ~/bin/conky_rss.sh "url_rss" 1 1 }
City B : ${execi 3600 ~/bin/conky_rss.sh "url_rss" 1 1 }
This fetches the weather from two cities every hour and first number “1” tells how many articles you want to be shown from the feed. I don’t know meaning of the second “1” but, if it was “0” it didn’t work. Replace the url_rss with the feed you wish.
This is how it looks like on my desktop:


