Obsidian - converting the RSS feed from °F to °C Thread last updated on 2006-04-17 23:52:36

Posted by member 302889 on 2006-02-19 14:08:05

Hi all,

in the Obsidian theme it has a nice weather function which takes an RSS feed from the yahoo weather site and shows info at the bottom of the taskbar for you to view.

the temp is in °F though and i want to show it in °C.

In the skinbase.rc file my RSS output is as follows...

RSSOutputString "{%1} - Temp is Currently {%3}°F --->> Forecast shows {%4}/{%5}°F with {%6}

...and the three temp values are shown by the pieces of code which are {%3} {%4} and {%5} which is info direct from the RSS feed.

i have written another line which looks like this...

DegreesC3 "${%3}-32*1.8$"

...but i'm not sure if that will work and when i try to replace the {%3} from the RSSOutputString with {DegreesC3} the output in my taskbar just shows the following...

Edinburgh, UK at 6:00pm GMT - Temp is Currently {DegreesC3}°F --->> Forecast shows blah blah

...instead of...

Edinburgh, UK at 6:00pm GMT - Temp is Currently 5°F --->> Forecast shows blah blah

Can anyone tell me how to go about writing some code which will convert the temp from fahrenheit to celsius?

i thought that the line of cod i wrote which does the conversion would store the value in a variable called 'DegreesC3' and i'd be able to insert that variable in the RSS output as a value but i'm not too clued up on litestep to be able to do this properly.

cheers

Posted by member 212670 on 2006-02-19 15:02:15 link

Simply open the vars.rc (Obsidian-v1\Config\Error\vars.rc), scroll down to the URL variable, and change the "f" at the end of the address to a "c." You'll notice on the yahoo weather site, before you clicked the RSS button, you could have first just clicked the "C." :P

Posted by member 250283 on 2006-04-17 22:25:43 link

Is there an option I need to activate to make the RSS feed work? I've set mine up with the correct URL in the vars.rc, but all I've ever seen from the display in the taskbar is "Loading... 0% complete".

Posted by member 1949 on 2006-04-17 23:52:36 link

replace !weather_add in the script.rc

*Script bang !Weather_Add
*Script exec !LabelClipboardCopy RSSError
*Script exec !Alert "$LngAlert2$"
*Script exec !Confirm "$LngConfirm3$" "$LngConfirm3Caption$" [http://weather.yahoo.com/][!none]
*Script exec !Alert "$LngAlert4$"
*Script exec !Alert "$LngAlert5$"
*Script exec !Alert "$LngAlert6$"
*Script exec !LabelInfoExport %%URL%% [clipboardtext]
*Script exec !Pause 250
*Script exec !Reload
*Script exec !NetReloadModule $WazupRevID$
*Script exec !Alert "$LngAlert7$"
*Script ~bang


and then replace this in the skinbase.rc
RSSLocalFile "$CacheDir$Weather.xml"
RSSUpdateInterval 3600
RSSCurrent "{*}Conditions for {%}{*}text={%quote}{%}{%quote}{*}temp={%quote}{%}{%quote}"
RSSDay "day={%quote}{%}{%quote}{*}low={%quote}{%}{%quote}{*}high={%quote}{%}{%quote}{*}text={%quote}{%}{%quote}"
RSSExtended "day={%quote}{%}{%quote}{*}low={%quote}{%}{%quote}{*}high={%quote}{%}{%quote}{*}text={%quote}{%}{%quote}"
RSSInputString "$RSSCurrent${*}$RSSDay${*}$RSSExtended$"
RSSOutputString "{%1} - It's Currently {%2} {%3} | {%4} {%7} Low:{%5} High:{%6} | {%8} {%11} Low:{%9} High:{%10}"
RSSEnabled true
RSSDisplayOn RSSText
RSSsilent true


I will be working finally on a update for this theme.
Sorry for the delay but real life has me a little busy.

Just a note this works with xLabel-3.5.7