SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-06-2004, 09:12 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
weather.com weather extractor for mlbdude2 1.8.7 (v1.1.1 / July 7)

Attached is a java weather extractor for the weather.com XML feed...

Features:
  • Global coverage
  • Imperial or metric units
  • customisable number of days to forecast (up to 10)
  • more forcast data (%chance of precipitation, wind, humidity)
Instructions in readme.txt in attached zipfile.

Any problems, post here, but note the known bugs section of the readme.

Note that because the weather icons are loaded using the description of the weather, not all icons are available in the mbdude2 skin. If an icon is not found to match the description, no icon will be shown
Weather.com's descriptions are very varied, and can include descriptions such as 'AM Sunny / PM Showers', so it is nearly impossible to create icons to match all descriptions.
However, To work around this, you need to create icons matching the missing desctiptions in the folder:
SageTV/STVs/OriginalV2/MlbDude/Default/weather

Update -- version 1.1.1 / July 7
  • Added more debugging info in readme.txt
  • Implement 1hr cache to speed up display if weather has been obtained recently, and to reduce load on weather.com's servers
  • Add forecast Wind, Humidity and % chance of precipitation
Update -- version 1.1.2 / July 8
  • make Precipitation and Humidity smaller, but add padding to force word-wrap.
  • Use non-breaking spaces where appropriate
Attached Files
File Type: zip weathercom_getweather.zip (14.1 KB, 1268 views)

Last edited by nielm; 07-26-2004 at 02:05 AM.
Reply With Quote
  #2  
Old 07-06-2004, 09:41 AM
Jack_PVR Jack_PVR is offline
Sage User
 
Join Date: May 2004
Posts: 58
No readme,txt in the file....

Maybe you could post it here?
Reply With Quote
  #3  
Old 07-06-2004, 09:47 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
D'oh -- updated attachment!
(I prefer to keep installation instructions in zipfile so that they don't go out of date if/when I release a new version)
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki
Reply With Quote
  #4  
Old 07-06-2004, 09:58 AM
Jack_PVR Jack_PVR is offline
Sage User
 
Join Date: May 2004
Posts: 58
Thanks nice job, installed and working!!
Reply With Quote
  #5  
Old 07-06-2004, 04:51 PM
kevthor kevthor is offline
Sage Aficionado
 
Join Date: Jun 2003
Posts: 254
I tried this and followed the instructions however when I click on weather in sage, I just hangs with the text "Loading..."


Any suggestions?
Reply With Quote
  #6  
Old 07-06-2004, 05:28 PM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
Did you try running the batch file manually (the run a test part of the readme)?

Were you able to get weather info with the original getweather.exe?

What location code are you using in the sage.properties?
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki
Reply With Quote
  #7  
Old 07-06-2004, 05:37 PM
kevthor kevthor is offline
Sage Aficionado
 
Join Date: Jun 2003
Posts: 254
Sorry it was my own mistake. I didn't have the Mlbdube folder in the original2 folder.

It is working now, Thanks.

oh btw: is there any way fix the bug "Sometimes the weather.com descriptions don't match the available icons in the MLBdude skin, and a blank icon is shown..."

Thanks
Reply With Quote
  #8  
Old 07-06-2004, 05:58 PM
Capt Dean Capt Dean is offline
Sage User
 
Join Date: Apr 2004
Location: Great Falls, MT
Posts: 51
Pretty sure I followed everything to the letter..... "Pretty sure" that is because my manual test yields the following:

Exception in thread "main" java.lang.NoClassDefFoundError: getweather3


Any ideas?

Thanks in advance
Reply With Quote
  #9  
Old 07-06-2004, 07:35 PM
Alex0230 Alex0230 is offline
Sage Advanced User
 
Join Date: Mar 2004
Location: AZ
Posts: 203
I was having that issue when running the batch file because it wasn't taking my parameters....try just replacing the %1 and %2 with your zip and Weather.txt respectively in the batch file.

"C:\jre142_05\bin\java" getWeather3 85204 Weather.txt %units% %numdays%

If that still doesn't work, it may be a jre version issue...but less likely. If you think it is a jre issue, you make need atleast the 1.4.2_5 package available here:

https://sdlcweb2a.sun.com/ECom/EComA...55c19cc856c150
__________________
ECS K7VTA3 + AthlonXP2400XP+ = $70
250 GB 7200 RPM HD = $160
512 MB Kingston DDR 333 = $80
Hauppage 350 Bundle = $220
SageTv = PriceLess

Last edited by Alex0230; 07-06-2004 at 07:48 PM.
Reply With Quote
  #10  
Old 07-06-2004, 08:07 PM
Capt Dean Capt Dean is offline
Sage User
 
Join Date: Apr 2004
Location: Great Falls, MT
Posts: 51
Tried exactly as you suggest... had jre _04 removed and installed up to _05.

Even edited the .bat precisely as you detail.

I still get the same exception error.
Reply With Quote
  #11  
Old 07-06-2004, 08:21 PM
Alex0230 Alex0230 is offline
Sage Advanced User
 
Join Date: Mar 2004
Location: AZ
Posts: 203
Are you running the command from the commandline, if so try running it from being in the same directory as the batch file.

I was getting different messages if I tried to run the batch file from different starting points.

------------------------------------------------------------------------------

C:\Documents and Settings\Alex>"C:\Documents and Settings\Alex\Desktop\New Folde
r (2)\weathercom_getweather\getweather.bat"
ECHO is off.
Exception in thread "main" java.lang.NoClassDefFoundError: getWeather3

C:\Documents and Settings\Alex>cd Desktop

C:\Documents and Settings\Alex\Desktop>cd "New Folder (2)"

C:\Documents and Settings\Alex\Desktop\New Folder (2)>cd weathercom_getweather

C:\Documents and Settings\Alex\Desktop\New Folder (2)\weathercom_getweather>getw
eather.bat
ECHO is off.
invalid units: 5
GetWeather3 -- weather.com extractor -- version 1.0.1
Usage:
getWeather3 <addr> [outfile] [units] [days] [fulldetails]
where:
addr=http://xoap.weather.com/weather/local/LOCATIONID
or addr=LOCATIONID (weather.com location code or US zip)
or addr=file:test.xml (local xml file for debugging purposes)
outfile=weather.txt
units=m for metric units, =s for imperial
days=number of days to forecast (up to 10)
fulldetails -- output all information -- makes incompatible weather.txt

C:\Documents and Settings\Alex\Desktop\New Folder (2)\weathercom_getweather>
__________________
ECS K7VTA3 + AthlonXP2400XP+ = $70
250 GB 7200 RPM HD = $160
512 MB Kingston DDR 333 = $80
Hauppage 350 Bundle = $220
SageTv = PriceLess
Reply With Quote
  #12  
Old 07-06-2004, 09:55 PM
Capt Dean Capt Dean is offline
Sage User
 
Join Date: Apr 2004
Location: Great Falls, MT
Posts: 51
I had been running it directly from the path where the batch file was located.

I ran it "indirectly" from my desktop folder.....

same result: Exception error
Reply With Quote
  #13  
Old 07-06-2004, 10:33 PM
Alex0230 Alex0230 is offline
Sage Advanced User
 
Join Date: Mar 2004
Location: AZ
Posts: 203
Now I feel like I'm just running you around in circles...I'm sorry, I'm just trying to give suggestions based off my experience. If I'm frustrating you...lol, just tell me to back off.

At this point I don't see it being an issue with java libraries, just how it's being called....very strange you know. Nielm based the program off the one I wrote, with the same library calls..so if mine runs on your machine, so "should" his based off library compatibility. I was able to replicate your issue by just how I ran the command in the command line. But was still able to run it correctly on the same machine by just changing the way I ran it from the command line.

Have you tried using it in Sage despite the problems with the manual execution...hint here, if it takes more than 15 seconds, just go back to the main menu, it probably didn't work.

-----------------------------------
Sage Props:

mlbdude/weather_exe=\\STVs\\OriginalV2\\MlbDude\\getweather.bat
mlbdude/weather_exe_java=false
mlbdude/weather_file=\\STVs\\OriginalV2\\MlbDude\\Weather.txt
mlbdude/weather_provider=www.weather.com
mlbdude/weather_url=
mlbdude/weather_zip=<location_code>

ui/main_menu_weather_enabled=true
ui/main_menu_weather_text=Weather
__________________
ECS K7VTA3 + AthlonXP2400XP+ = $70
250 GB 7200 RPM HD = $160
512 MB Kingston DDR 333 = $80
Hauppage 350 Bundle = $220
SageTv = PriceLess

Last edited by Alex0230; 07-06-2004 at 10:42 PM.
Reply With Quote
  #14  
Old 07-06-2004, 10:42 PM
Capt Dean Capt Dean is offline
Sage User
 
Join Date: Apr 2004
Location: Great Falls, MT
Posts: 51
Quote:
Originally posted by Alex0230
Now I feel like I'm just running you around in circles...I'm sorry, I'm just trying to give suggestions based off my experience. If I'm frustrating you...lol, just tell me to back off.
Are you kidding me! You're helping me. Why would I get frustrated with you? I REALLY appreciate your help.

Yes, I have tried running it in Sage. It just hangs.

Let me verify. I unzip the weather folder.... copy all the files into the mlbdude folder where the getweather.exe file is and set the parameters in the .bat and in the sageproperties?

I've done all this. Man, what can I be messin' up here?
Reply With Quote
  #15  
Old 07-06-2004, 10:51 PM
Alex0230 Alex0230 is offline
Sage Advanced User
 
Join Date: Mar 2004
Location: AZ
Posts: 203
Did you do it with Sage completely closed? Any changes to the params in the props file aren't taken if sage is running/sleeping.

This is how I would do it, see if you haven't tried an of these:
-I would say try unzipping the files in to the mlbdude folder where getWeather is.
-Make the change to your batch file only so you have to specify the path to the java exe. ex: C:\jre_142_05\bin\java getWeather3 %1 %2 %units% %numdays%
-Make the changes to your props file, exactly like this, but with your zip:

mlbdude/ weather_exe=\\STVs\\OriginalV2\\MlbDude\\getweathe
r.bat
mlbdude/weather_exe_java=false
mlbdude/weather_file=\\STVs\\OriginalV2\\MlbDude\\Weather.txt
mlbdude/weather_provider=www.weather.com
mlbdude/weather_url=
mlbdude/weather_zip=85009

ui/main_menu_weather_enabled=true
ui/main_menu_weather_text=Weather

-Restart Sage
-Cross Fingers
__________________
ECS K7VTA3 + AthlonXP2400XP+ = $70
250 GB 7200 RPM HD = $160
512 MB Kingston DDR 333 = $80
Hauppage 350 Bundle = $220
SageTv = PriceLess
Reply With Quote
  #16  
Old 07-07-2004, 01:22 AM
redman's Avatar
redman redman is offline
Sage Advanced User
 
Join Date: Apr 2004
Location: Malaysia
Posts: 159
You Rock.

That is brilliant. I finally have everything starting to work properly.

UI on 350 output with the new drivers, Nice new skin, and now real weather working.


Thanks to you and everyone else.

Reply With Quote
  #17  
Old 07-07-2004, 02:58 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
Quote:
Originally posted by Capt Dean
Exception in thread "main" java.lang.NoClassDefFoundError: getweather3
The error message is indicating that java.exe cannot find the getWeather3.class file. Normally you would not see this error if you are running the .bat file from the directory where the getWeather3.class file is.

Is that a direct copy of the error message -- because the the class name is case-sensitive, and it should be getWeather3 (note the capital 'W').
If so it seems that the class name is being magically translated to all lower case, and so the java.exe cannot find it...

Try putting getWeather3 in quotes ("getWeather3") in the batch file as a possible workaround and see if the manual test works...

(I tested on W2K and WXP -- are you running W98/ME?)
Reply With Quote
  #18  
Old 07-07-2004, 03:09 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
Quote:
Originally posted by kevthor
is there any way fix the bug "Sometimes the weather.com descriptions don't match the available icons in the MLBdude skin, and a blank icon is shown..."
quick answer: the icons are in:
SageTV/STVs/OriginalV2/MlbDude/Default/weather
and the names of the icons need to match the descriptions -- create new icons to match the missing descriptions.

long answer:
The weather icons are currently loaded based on the description.
Weather.com's descriptions are very varied, and can include descriptions such as 'AM Sunny / PM Showers', so it is nearly impossible to create icons to match all descriptions.
However, weather.com does include a weather icon ID in the XML feed, and I am working with mlbdude to be able to pass this icon ID to the STV, so that he can load an image from weather.com's icon set.

So, it will be fixed, eventually...
Reply With Quote
  #19  
Old 07-07-2004, 07:20 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
Update -- version 1.1.1 / July 7
  • Added more debugging info in readme.txt
  • Implement 1hr cache to speed up display if weather has been obtained recently, and to reduce load on weather.com's servers
  • Add forecast Wind, Humidity and % chance of precipitation
Download here
Reply With Quote
  #20  
Old 07-07-2004, 07:27 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
Attached is a Screenshot with the additional information shown...
Attached Images
File Type: jpg weather.jpg (68.6 KB, 1012 views)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 01:35 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.