kaelri / enigma

A featured "suite" for the Windows system monitoring application, Rainmeter.
https://www.kaelri.com/project/enigma/
270 stars 93 forks source link

Weather showing today's forecast twice #80

Closed quasimodo93 closed 9 years ago

quasimodo93 commented 9 years ago

So I set the weather extended widget and my city through the weather code app. It shows the current temperature, wind, humidity, etc. But below it shows the day's average again, where it should show the next day's average. asdf

ghost commented 9 years ago

Try uninstalling and again updating enigma or just download another weather forecast for RainMeter. Can't help you much there, never had that problem. Or perhaps the forecast is the same for today and tomorow? Have you tried checking if that is true on the forecast website http://www.weather.com/

quasimodo93 commented 9 years ago

Already tried uninstalling and updating, nothing changed. I think I found what the problem is. So I went into the widget's .ini and .inc and found out it reads the forecast from this site: http://weather.yahooapis.com/forecastrss?p=PAXX0001&u=c Where PAXX0001 is my city's code. So the site shows the current conditions and below it shows today's forecast and the next day's one and so on. It seems that the widget reads the current conditions as the first day, and today's forecast as the second day as it thinks that should be the second day's forecast. This is a screenshot from that site. asdfasdf And this one from the widget. asdf Both are from today's forecast.

Anyway, if you or anyone knows how the code works and could help me. The .inc that measures the forecast is at @Resources\Measures\YahooWeather.inc. I can barely read that code and couldn't figure out how to make it work.

ghost commented 9 years ago

I will take a look at the code, I don't code but I guess I will try fixing it cause I do get the basic idea. No promises.

ghost commented 9 years ago

Also.. do you live in Asuncion?

ghost commented 9 years ago

Ahhhh... it seems that it is not in the .ini or the .inc files.... they are not a problem. This seems to be a bug. It shows correctly for me doe :/ The problem is that it does not just download the text and format it from the .ini, it is formatted by a plugin located at "C:\I have no idea where\" and probably is hard coded to a .exe file or something so I can't edit it. I had a problem with the weather before because it was not showing the location so I did that thing below (or the short version on the very bottom):

Try this (it will may not not and probably won't fix your problem):

  1. Locate and open this file: C:\Users\USERNAME\Documents\Rainmeter\Skins\Enigma\@Resources\Measures\YahooWeather.inc
  2. Now go to this website: https://weather.yahoo.com/ In the search bar locate your city and click on it. Once the forecast shows scroll until you see a button that says: "Extended Forecast >" and click it.

The link will be something like this:

http://www.weather.com/weather/extended/FRXX0011?par=yahoo&site=www.yahoo.com&promo=extendedforecast&cm_ven=Yahoo&cm_cat=www.yahoo.com&cm_pla=forecastpage&cm_ite=CityPage

  1. Now shrink it down and we get: http://www.weather.com/weather/extended/FRXX0011 (the code is fake just so everyone does not know where I live)

Remember the line 5 in the file you opened earlier? It SHOULD be this: Url=http://weather.yahooapis.com/forecastrss?w=#CurrentCode#&u=#Unit# NOTE: It that is not line 5 then locate that text somewhere else in the file (maybe it is line 3 or 6).

  1. You now want to replace the #CurrentCode# with the code that we got from the link, in my case it is FRXX0011. The line 5 will look like this now:

Url=http://weather.yahooapis.com/forecastrss?w=FRXX0011&u=#Unit#

The next thing you want to change is #Unit#, depending if you want Celsius or Fahrenheit you will change #Unit# to "c" or "f"

If you want Celsius it will be: Url=http://weather.yahooapis.com/forecastrss?w=FRXX0011&u=c

Or Fahrenheit: Url=http://weather.yahooapis.com/forecastrss?w=FRXX0011&u=f

I hope this is not too complicated, if you want to just read the short version below:

  1. Open YahooWeather.inc
  2. a) Go here: https://weather.yahoo.com/ b) Find your city and click on it c) Click "Extended Forecast >" on the forecast for your city (located somewhere in the middle)
  3. Copy ONLY THE CODE found IN THE LINK: Exapmle link: http://www.weather.com/weather/extended/FRXX0011 (everything after the FRXX0011 does not matter)
  4. Once you copied the code (in my case: FRXX0011) replace the folowing line in the file you opened earlier: Url=http://weather.yahooapis.com/forecastrss?w=#CurrentCode#&u=#Unit#
  5. Replce it with your code: Url=http://weather.yahooapis.com/forecastrss?w=FRXX0011&u=#Unit#
  6. Replace the unit #Unit# ("u=c" is celsius and "u=f" is fahrenheit) Url=http://weather.yahooapis.com/forecastrss?w=FRXX0011&u=c (this is celsius)

OR:

Url=http://weather.yahooapis.com/forecastrss?w=FRXX0011&u=f (this is fahrenheit)

You are done! Now this may not fix your problem but it did mine, this is basicly forcing the skin to use your location and temperature unit. WTH?! I checked that the steps were 1. 2. 3. and 4. but in the Preview it shows 1. 2. 1. 1. (if this is the case.... I hope you know how to count from 1 to 4 :D

ghost commented 9 years ago

Yup, it shows 1. 2. 1. 1. steps BECAUSE GITHUB DOES NOT KNOW HOW TO COUNT (like really, I checked like 5 times to make sure the numbers were 1 2 3 4 and not 1 2 1 1)

quasimodo93 commented 9 years ago

I do live in Asuncion. Tried what you said. Still getting same results. asdfsd Still getting today's current conditions and today's average below it.

quasimodo93 commented 9 years ago

I got to make it work myself. Don't know much about coding, but in the YahooWeather.inc I saw that just in the sixth line the code starts with RegExp and to me it seems it's actually measuring the RSS. So what I did was add an extra piece of code to it. It looks like this: RegExp=(?siU)<link.>(._).city=\"(.)\".region=\"(.)\".country=\"(.)\".temperature=\"(.)\".distance=\"(.)\".pressure=\"(.)\".speed= \"(.)\".chill=\"(.)\".direction=\"(.)\".speed=\"(.)\".humidity=\"(.)\".visibility=\"(.)\".pressure=\"(.)\".rising=\"(.)\".sunrise= \"(.)\".sunset=\"(.)\"..</em>:.<em>m .</em>(._).lat>(.)<.long>(.)<._yweather:condition.text=\"(.)\".code=\"(.)\".temp= \"(.)\"._yweather:forecast.day=\"(.)\".low=\"(.)\".high=\"(.)\".text=\"(.)\".code=\"(.)\"._yweather:forecast.day=\"(.)\".low=\"(.)\".high= \"(.)\".text=\"(.)\"._code=\"(.)\".

And I just added an extra ._yweather:forecast.day=\"(.)\".low=\"(.)\".high= \"(.)\".text=\"(.)\"._code=\"(.*)\". to the end. The original has 2 of those, mine has 3 now. So it measures 3 days, not just 2.

Then I went to look for every measure about the days and changed the days being measured. So Day2 became Day3, Day3 became Day4. So I changed every piece of code containing Day#. Did the same on the Weather.inc at Rainmeter\Skins\Enigma\Sidebar\Weather.

Here's a comparison. This was what was bothering me. Showing today's average after the current conditions. asdf And here it is fixed. asdfasdf

ghost commented 9 years ago

OK, So you were talking about the icons for tomorrow and after tomorrow? I never actually noticed that myself but it happends to me. I'm not annoyed or botherd by that because I use a weather app on my phone.

quasimodo93 commented 9 years ago

No, not talking about the icons. Talking about the forecast it shows for tomorrow and the day after. You see, in the first screenshot on my last post, it's thursday the 25th at 1:55pm. What was bothering me is that it shows me all the current conditions of the weather and below them it shows me the average temperature for thursday. I don't need today's average when I'm getting all the current conditions. So it's kinda useless to get the average when I get more precise info about the weather just above it. What I wanted it to do was to show me first: the current weather conditions. Then: Tomorrow's average. And at last: The day after tomorrow's average. And that's how I did it. I know it's pretty messy but at least I got it to work.

ghost commented 9 years ago

Please mark this as closed science it is closed.