XoapWeather 1.1

Xlobby plugin development

XoapWeather 1.1

Postby bradsjm on Sun Sep 05, 2004 8:35 pm

This is XoapWeather 1.1 - a weather plugin for Xlobby.

This plugin is useful for skin developers or experienced users who understand how to modify skins.

Why a new weather plug-in you may ask? Well first because at the time I started writing this the bundled plug-in had stopped working and secondly because there were some features I wanted to add. This will be the last release of this package.

Features:

* Support for SEVERE WEATHER ALERTS. You can now show a visible alert icon (use the variable weatheralert) and display (ticker tape style if you want) severe weather alerts which are picked up in the Weather.com feed (US only feature).

* Uses Weather.com Xoap Web Service instead of scraping Yahoo weather (which means it is less likely to break in the future) for everything except the radar image which is grabbed in the same way the original plug-in does it You can override the radar image url

* User defined weather text variables! There are only two hardcoded variables (one is radar, the other is weatheralert) the rest can be defined using the configuration screen to use any XPATH query you want. If the data is in the XML file you can retrieve it and manipulate it. Don't worry if you don't know XPATH, I've provided the most common variables in the download for you. To see what the XML looks like and what data is in there try this link: http://xoap.weather.com/weather/local/USMO0614?cc=*&dayf=5&dayd=5

* Reads your existing forecasts.xml file for compatibility if you copy it to the new plugin directory (it will add some new tags to it).

* Caching of weather data and transformations

* Caches and obeys Weather.com limits on how often weather data is retrieved -- Automatic update of current conditions every 20 minutes and a full forecast every 2 hours.

* Complete open source (C#) available in SourceForge at http://sourceforge.net/projects/xoapweather/ and I welcome anyone taking over maintenance.

The plug-in itself can be downloaded from
http://prdownloads.sourceforge.net/xoapweather/xoapweather1.1.zip?download

Some examples of using the variables in your screens:
Code: Select all
Current weather icon: plugin>xoapweather>current>nowicon

Weather alert image (if active): plugin>xoapweather>current>weatheralert

Radar image: plugin>xoapweather>current>radar

Current Temperature: plugin>xoapweather>current>%temperature%

Tomorrow's detailed outlook: plugin>xoapweather>current>1>%detaileddayoutlook%

Tomorrow night detailed outlook: plugin>xoapweather>current>1>%detailednightoutlook%

Tomorrow daytime weather icon: plugin>xoapweather>current>1>dayicon

NOTE! Install this plugin in a different subdirectory from the xweather plugin so you can revert back if required!
Last edited by bradsjm on Sat Sep 25, 2004 1:54 pm, edited 2 times in total.
bradsjm
 
Posts: 18
Joined: Sun Sep 05, 2004 6:12 pm
Location: New York City

Postby BaddaBing on Mon Sep 06, 2004 3:10 am

bradjsm,
Great work on this! :D
I'm using your XoapWeather as the default weather plugin in my HeavyMetal skin. I have your work credited on my download thread (http://www.xlobby.com/forum/viewtopic.php?t=1849&postdays=0&postorder=asc&start=0) but wanted to come over to your post and say thanks directly to you.
-baddabing
BaddaBing
 
Posts: 557
Joined: Fri Mar 26, 2004 2:39 pm
Location: DFW Texas

Postby AirPost on Mon Sep 06, 2004 4:47 am

Jonathan, thanks for this awesome plugin. I have had problems with the default weather plugin just because it breaks once in awhile but yours seems to "stick". Thanks again. :wink:
AirPost
 
Posts: 160
Joined: Sat Mar 27, 2004 6:37 pm
Location: Sin City

Postby wads on Mon Sep 06, 2004 5:48 am

Could you please post a list of all of the variables for all of the weather functions.

Thank you
Darren
wads
 
Posts: 10
Joined: Sun Sep 05, 2004 7:56 pm

Postby wads on Mon Sep 06, 2004 6:09 am

Never mind sorry. I see the list in the plugin. Is that the complete list?
wads
 
Posts: 10
Joined: Sun Sep 05, 2004 7:56 pm

Postby Aaron on Mon Sep 06, 2004 6:09 am

Brad,
This looks very nice!
I cannot get it to work, at all... I'm using BB's HeavyMetal skin.

Here's my steps...

Removed the xweather plug-in
Input my location
Clicked Search... seemed to find it fine.
Restarted XL

status says "Loaded"

help please
Aaron
 
Posts: 299
Joined: Fri May 07, 2004 3:50 am

Postby AirPost on Mon Sep 06, 2004 6:40 am

Got all working except the 4th dayicon. I have the current, 1, 2 & 3 dayicons showing fine but the 4 dayicon is just showing the variable and not the icon.

ie.plugin>xoapweather>current>4>dayicon

Am I missing something? Is this related to the images/icons I'm using? I'm using a different set of weather icons.

Affini: For mine, I didn't remove my xweather plugin but just added the xoapweather directory to the plugins subdirectory. Copied my "images" folder from xweather to xoapweather. Went to the plugins tab and selected my location. Went to my weather page and started adding the variables:

ie. plugin>xoapweather>current>%temperature%
plugin>xoapweather>current>nowicon
plugin>xoapweather>current>%outlook%
AirPost
 
Posts: 160
Joined: Sat Mar 27, 2004 6:37 pm
Location: Sin City

Postby wads on Mon Sep 06, 2004 7:33 am

Jonathan,

How about adding a variable for displaying the current condition in a text format, such as "calm" or "cloudy". The orig plugin does that and I like it.

For barometric pressure, you should include whether it is "falling","rising", or "steady".
For wind, include the unit (mph, etc) and the direction. like: 5 mph N

If it were me, I am a programmer, I would add all available information (from web) as variables to the plugin. Let the user decide whichever he wants to use.

Food for thought. I know I would appreciate that.

Darren
wads
 
Posts: 10
Joined: Sun Sep 05, 2004 7:56 pm

Postby bradsjm on Mon Sep 06, 2004 4:32 pm

AirPost wrote:Got all working except the 4th dayicon. I have the current, 1, 2 & 3 dayicons showing fine but the 4 dayicon is just showing the variable and not the icon.

ie.plugin>xoapweather>current>4>dayicon

Am I missing something? Is this related to the images/icons I'm using? I'm using a different set of weather icons.

Your format is correct. It could be related to the icons you are using but I would have expected nothing to show instead of the variable name. The current code might throw an error if the image doesn't exist (fixed for next release). If the variable name is showing it normally means the parser couldn't resolve it.

If you are still having the problem let me know what your location is so I can grab the Weather.com XML and see what it is returning for the icon number :)
bradsjm
 
Posts: 18
Joined: Sun Sep 05, 2004 6:12 pm
Location: New York City

Postby bradsjm on Mon Sep 06, 2004 4:48 pm

wads wrote:Jonathan,

How about adding a variable for displaying the current condition in a text format, such as "calm" or "cloudy". The orig plugin does that and I like it.

For barometric pressure, you should include whether it is "falling","rising", or "steady".
For wind, include the unit (mph, etc) and the direction. like: 5 mph N

If it were me, I am a programmer, I would add all available information (from web) as variables to the plugin. Let the user decide whichever he wants to use.

Food for thought. I know I would appreciate that.

Darren

Thanks for your feedback!

I think you will find the existing code has your first request :) The %outlook% variable provides the current condition as in "Cloudy" or "Sunny" etc. It is also available for the future day forecasts but you need to specify %dayoutlook% or %nightoutlook% as both are available :)

For the barometric pressure direction and wind I'll add that to the default variable list in the next version but you can do it right now if you want! (I love this part of the plugin design!) :D
Code: Select all
Add the following to the variables tab in the configuration:

Variable: barometerdirection
XPath: /weather/cc/bar/d

Variable: winddirection
XPath: /weather/cc/wind/t

Variable: windgust
XPath: /weather/cc/wind/gust

Variable: speedunit
XPath: /weather/head/us


Then use something like this for the barometer button text:
plugin>xoapweather>current>Barometer: %barometer% (%barometerdirection%)

And something like this for the wind button text:
plugin>xoapweather>current>Wind: %wind% %speedunit% %winddirection%
bradsjm
 
Posts: 18
Joined: Sun Sep 05, 2004 6:12 pm
Location: New York City

Postby Aaron on Mon Sep 06, 2004 4:53 pm

Jonathan...

Can you give me a bit'o help?

(posted problem above)
Aaron
 
Posts: 299
Joined: Fri May 07, 2004 3:50 am

Postby bradsjm on Mon Sep 06, 2004 5:07 pm

Affini wrote:This looks very nice!
I cannot get it to work, at all... I'm using BB's HeavyMetal skin.

Here's my steps...

Removed the xweather plug-in
Input my location
Clicked Search... seemed to find it fine.
Restarted XL

status says "Loaded"

help please

Your steps are good and I just downloaded the HeavyMetal skin and it works fine with it (nice skin!). Go back and make sure your location is actually showing up in the plugin configuration list and tell me what the location is so I can look at the Weather.com XML for that location.
bradsjm
 
Posts: 18
Joined: Sun Sep 05, 2004 6:12 pm
Location: New York City

Postby wads on Mon Sep 06, 2004 7:06 pm

Thank you Jonathon

I was not aware that you can add variables. Nuff said. I will check that.

Darren
wads
 
Posts: 10
Joined: Sun Sep 05, 2004 7:56 pm

Postby AirPost on Mon Sep 06, 2004 8:35 pm

If you are still having the problem let me know what your location is so I can grab the Weather.com XML and see what it is returning for the icon number


Here it is: USAK0070

Thanks for checking.
AirPost
 
Posts: 160
Joined: Sat Mar 27, 2004 6:37 pm
Location: Sin City

Postby bradsjm on Mon Sep 06, 2004 8:59 pm

AirPost wrote:
If you are still having the problem let me know what your location is so I can grab the Weather.com XML and see what it is returning for the icon number


Here it is: USAK0070

Thanks for checking.

I just added Dutch Harbor, AK to my system and it came back fine and showed all the forecast details so it isn't an issue with the code or Weather.com.

I suggest making sure you have the latest Xlobby2 zip file at: http://www.xlobby.com/xlobby2.zip since that is what I am using.
bradsjm
 
Posts: 18
Joined: Sun Sep 05, 2004 6:12 pm
Location: New York City

Next