It is currently May 8th, 2024, 1:27 pm

weather forecast problem

Get help with creating, editing & fixing problems with skins
SilverFLurri
Posts: 9
Joined: April 6th, 2011, 2:43 am

weather forecast problem

Post by SilverFLurri »

i searched around for an answer to this but couldn't find anything specific to my problem.

I'm getting the high and low temperatures from this link: http://xml.weather.com/weather/local/#location#?cc=*&unit=m&dayf=10
my question is what does the 10 mean at the end, the 10th day in the forecast (this is what i assumed)?
because i get no high/low numbers if i use 0, 1, 2, 3. but i do get the high/low temperatures if i use any number above 3.
So i'm a little confused as to what is going on with the link.

and a side problem thats not super important atm: does updaterate determine how often the skin will refresh it's self, or just how often it re-gathers the data. because it seems the skin is correctly getting the numbers, but not updating unless i refresh the whole skin.

thanks.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: weather forecast problem

Post by jsmorley »

SilverFLurri wrote:i searched around for an answer to this but couldn't find anything specific to my problem.

I'm getting the high and low temperatures from this link: http://xml.weather.com/weather/local/#location#?cc=*&unit=m&dayf=10
my question is what does the 10 mean at the end, the 10th day in the forecast (this is what i assumed)?
because i get no high/low numbers if i use 0, 1, 2, 3. but i do get the high/low temperatures if i use any number above 3.
So i'm a little confused as to what is going on with the link.

and a side problem thats not super important atm: does updaterate determine how often the skin will refresh it's self, or just how often it re-gathers the data. because it seems the skin is correctly getting the numbers, but not updating unless i refresh the whole skin.

thanks.
The dayf=10 setting on weather.com's feed tells it to give you 10 days worth of forecasts. With that URL you should get info for "current", then "today's forecast" and forecasts for nine additional days.

Now, how the skin is using that feed is another matter. I suspect whatever skin you have (It's always nice to post a link to where you got the skin, or tell us the name, or post the actual skin code inside "" tags, so we are not just talking in generalities when helping you) is designed to use 3 days worth of that feed. So changing that number to less than 3 will just break the skin, and anything over 3 is just ignored.
SilverFLurri
Posts: 9
Joined: April 6th, 2011, 2:43 am

Re: weather forecast problem

Post by SilverFLurri »

jsmorley wrote: The dayf=10 setting on weather.com's feed tells it to give you 10 days worth of forecasts. With that URL you should get info for "current", then "today's forecast" and forecasts for nine additional days.

Now, how the skin is using that feed is another matter. I suspect whatever skin you have (It's always nice to post a link to where you got the skin, or tell us the name, or post the actual skin code inside "" tags, so we are not just talking in generalities when helping you) is designed to use 3 days worth of that feed. So changing that number to less than 3 will just break the skin, and anything over 3 is just ignored.
ah ok, that totally makes sense now. thanks, also is it normal that weather.com doesn't show the highs for the current day. Because it's listed as N/A right now on their website (and the skin ofc). just wondering if that was normal or not, if it is i might switch to yahoo or something.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: weather forecast problem

Post by jsmorley »

SilverFLurri wrote: ah ok, that totally makes sense now. thanks, also is it normal that weather.com doesn't show the highs for the current day. Because it's listed as N/A right now on their website (and the skin ofc). just wondering if that was normal or not, if it is i might switch to yahoo or something.
That is normal for the "forecast" for the current day on weather.com. Once it is past a certain hour, it's not a "forecast" any more, but "current", then "history". ;-) It's a strange and stupid setup they have for an RSS feed in my opinion. I use Yahoo myself. The downside is that Yahoo ONLY has a three day forecast, but that is enough for me.
SilverFLurri
Posts: 9
Joined: April 6th, 2011, 2:43 am

Re: weather forecast problem

Post by SilverFLurri »

jsmorley wrote: That is normal for the "forecast" for the current day on weather.com. Once it is past a certain hour, it's not a "forecast" any more, but "current", then "history". ;-) It's a strange and stupid setup they have for an RSS feed in my opinion. I use Yahoo myself. The downside is that Yahoo ONLY has a three day forecast, but that is enough for me.
ah, how weird. and i just saw a little thing on yahoo that says its powered by weather.com lol. but interestingly enough the yahoo website shows the high/low for today, where as weather.com doesn't. BUT if i click forecast on yahoo, then the na pops up for todays high.
right now i'm pulling the current high/low like <weather ver="(.*)">(.*)<tmp>(.*)</tmp>(.*)<hi>(.*)</hi>(.*)<low>(.*)</low>(.*)<t>(.*)</t>(.*)<icon>(.*)</icon>(.*) which i think/hope is correct.

is it possible to pull the high for the current day from http://xml.weather.com/weather/local/#location#?cc=*&unit=m&dayf=10 and not have it change to na when it's past it's peak (so it still shows at like 10pm that night). or would i have to switch to yahoo. and if i do have to switch to yahoo, how would i pull the images in regexp (previously i got the temp working fine, but the images didnt work ><).
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: weather forecast problem

Post by jsmorley »

Here is my RegExp for my Yahoo skin:

[MeasureYahooWeather]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1200
URL=http://weather.yahooapis.com/forecastrss?w=#Location#&u=#Unit#
RegExp="(?siU)<title>.*- (.*)</title>.*<link>(.*)/\*(.*)</link>.*<description>(.*)</description>.*<language>(.*)</language>.*<lastBuildDate>(.*)</lastBuildDate>.*<yweather:location city="(.*)".*region="(.*)".*country="(.*)".*<yweather:units temperature="(.*)".*distance="(.*)".* pressure="(.*)".*speed="(.*)".*<yweather:wind chill="(.*)".*direction="(.*)".*speed="(.*)".*<yweather:atmosphere humidity="(.*)".* visibility="(.*)".*pressure="(.*)".* rising="(.*)".*<yweather:astronomy sunrise="(.*)".*sunset="(.*)".*<title>(.*)</title>.*<width>(.*)</width>.*<height>(.*)</height>.*<link>(.*)</link>.*<url>(.*)</url>.*<title>(.*)</title>.*<geo:lat>(.*)</geo:lat>.*<geo:long>(.*)</geo:long>.*<link>(.*)/\*(.*)</link>.*<pubDate>(.*)</pubDate>.*<yweather:condition text="(.*)".*code="(.*)".*temp="(.*)".*date="(.*)".*<img src="(.*)".*Current Conditions:</b><br />(.*)<BR />.*Forecast:</b><BR />(.*)<br />.*(.*)<br />.*<a href="(.*)/\*(.*)">.*provided by <a href="(.*)" >(.*)</a>.*<yweather:forecast day="(.*)".*date="(.*)".*low="(.*)".*high="(.*)".*text="(.*)".*code="(.*)".*<yweather:forecast day="(.*)".*date="(.*)".*low="(.*)".*high="(.*)".*text="(.*)".*code="(.*)".*"

So for my URL, which is:

http://weather.yahooapis.com/forecastrss?w=12766801&u=f

I get the following in the StringIndexes:

01=> Fairfax, VA
02=> http://us.rd.yahoo.com/dailynews/rss/weather/Fairfax__VA
03=> http://weather.yahoo.com/forecast/USVA0140_f.html
04=> Yahoo! Weather for Fairfax, VA
05=> en-us
06=> Sat, 16 Apr 2011 6:11 pm EDT
07=> Fairfax
08=> VA
09=> United States
10=> F
11=> mi
12=> in
13=> mph
14=> 63
15=> 140
16=> 12
17=> 88
18=> 10
19=> 29.46
20=> 2
21=> 6:31 am
22=> 7:45 pm
23=> Yahoo! Weather
24=> 142
25=> 18
26=> http://weather.yahoo.com
27=> http://l.yimg.com/a/i/brand/purplelogo//uh/us/news-wea.gif
28=> Conditions for Fairfax, VA at 6:11 pm EDT
29=> 38.88
30=> -77.38
31=> http://us.rd.yahoo.com/dailynews/rss/weather/Fairfax__VA
32=> http://weather.yahoo.com/forecast/USVA0140_f.html
33=> Sat, 16 Apr 2011 6:11 pm EDT
34=> Mostly Cloudy
35=> 28
36=> 63
37=> Sat, 16 Apr 2011 6:11 pm EDT
38=> http://l.yimg.com/a/i/us/we/52/28.gif
39=> Mostly Cloudy, 63 F
40=> Sat - Thunderstorms Early. High: 62 Low: 47
41=> Sun - Sunny/Wind. High: 67 Low: 48
42=> http://us.rd.yahoo.com/dailynews/rss/weather/Fairfax__VA
43=> http://weather.yahoo.com/forecast/USVA0140_f.html
44=> http://www.weather.com
45=> The Weather Channel
46=> Sat
47=> 16 Apr 2011
48=> 47
49=> 62
50=> Thunderstorms Early
51=> 47
52=> Sun
53=> 17 Apr 2011
54=> 48
55=> 67
56=> Sunny/Wind
57=> 24
SilverFLurri
Posts: 9
Joined: April 6th, 2011, 2:43 am

Re: weather forecast problem

Post by SilverFLurri »

wohhh, so much info haha. thanks sooo much, will take my time going through this and re making my weather skin xD.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: weather forecast problem

Post by jsmorley »

:-)

I don't use it all, but it's there if I need it for another skin and I can just copy and paste that RegExp that "has it all".

What I end up with for my normal skin is:
4-16-2011 10-12-05 PM.jpg
You do not have the required permissions to view the files attached to this post.
SilverFLurri
Posts: 9
Joined: April 6th, 2011, 2:43 am

Re: weather forecast problem

Post by SilverFLurri »

hm ok well for some reason i can't get your'e regexp to work (in rainregexp it gives me an error) but so far i've been able to take just the parts i need/want and make it work.

so right now i've got: "(?siU).*<yweather:atmosphere humidity="(.*)".*<yweather:forecast day="(.*)".*date="(.*)".*low="(.*)".*high="(.*)".*<yweather:forecast day="(.*)".*date="(.*)".*low="(.*)".*high="(.*)".*"

for humidity, day, date, low, high, and the same for the next day

the only problem i'm having now is images. I want to use the numbered images in my skins folder instead of yahoo gifs. previously with weather.com i used (.*)<icon>(.*)</icon> and it would return a number that would correspond with the correct image in the skins folder. is it possible to do this with yahoo?
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: weather forecast problem

Post by jsmorley »

code=

Is the part that returns the number of the image(s).