It is currently March 28th, 2024, 11:24 am

Yahoo.com - weather.com alternative

Weather skins
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5380
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Yahoo.com - weather.com alternative

Post by eclectic-tech »


Updated: Feb 12, 2023 (Updated 2/14: streamlined RegExp)
JSON data was removed by Yahoo; now this skin scrapes the website code for data
Of course, this will only work as long as they don't make any more website changes. :x
** Special thanks to Xenium for sharing his weather icon set and info! ** :rosegift:

This may look familiar... I completely 'stole' JSMorley's 'weather.com' to present this 'yahoo.com' version...

With the passing of the wxdata weather feed, several of us thought we might be able to simply parse the information directly from the https://www.yahoo.com/news/weather/ site.


1 to 10 day display via scrolling
{Click to view animation...}
yahoo10.gif

The site will automatically determine your location based on your ISP location. If you want a more precise location, go to the site, change to your location, then copy the address bar as 'URLSite={yourAddressBar}' in 'YahooComVariables.inc'.

V 1.2023.02.14
Minor update to streamline and organize RegExp and Measures

V 1.2023.02.12
Corrected Conditions Substitution
Webparser UpdateRate set to default

V 1.2023.02.11
Yahoo removed JSON data from the website in Dec '22
Modified to use website code for data
Attachments
Yahoo.com_2023_1.2023.02.12.rmskin
(3.02 MiB) Downloaded 210 times
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: yahoo.com - Parsing the JSON

Post by jsmorley »

Nice, always good to have alternatives, given that these weather sites change and even come and go from time to time.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm
Contact:

Re: yahoo.com - Parsing the JSON

Post by SilverAzide »

This is great! Thanks, ET! :thumbup:

The example skin is working, but I am having an issue with the location data. When I use the "auto" location URL, it puts me in the center of the US in Kansas a thousand miles away from me, but the location data parsing works OK even though there is some missing. When I use a specific location, like Fort Hunt, VA, the location data changes its structure and as a result the whole block of location measures fail.

When I use the "auto-location" URL, the regexp works but I get this (revised and formatted for simplicity):

Code: Select all

{
  "weathers": {
    "23424977": {
      "woeid": 23424977,
      "unit": "imperial",
      "location": {
        "woeid": 23424977,
        "photoWoeid": 23424977,
        "displayName": "United States",
        "latitude": 37.167931,
        "longitude": -95.845016,
        "offsetSecs": 0
      }
    }
  },
  "preference": {
    "unit": "imperial"
  }
},
"WeatherLocationStore": {
  "currentLocation": {
    "city": "",
    "country": "United States",
    "lat": "37.16793",
    "lon": "-95.845017",
    "qualifiedName": "United States",
    "state": "",
    "statecode": "",
    "woeid": 23424977
  },
  "favoriteLocations": [],
  "searchLocations": []
}
When I use the sample Fort Hunt URL, the regexp fails because I get this:

Code: Select all

{
  "weathers": {
    "23418210": {
      "woeid": 23418210,
      "unit": "imperial",
      "location": {
        "woeid": 23418210,
        "photoWoeid": 23418210,
        "countryName": "United States",
        "displayName": "Fort Hunt",
        "latitude": 38.736118,
        "longitude": -77.058929,
        "offsetSecs": -14400
      }
    }
  },
  "preference": {
    "unit": "imperial"
  }
},
"WeatherLocationStore": {
  "currentLocation": {
    "woeid": 23418210
  },
  "favoriteLocations": [],
  "searchLocations": []
}
Any ideas?
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5380
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: yahoo.com - Parsing the JSON

Post by eclectic-tech »

Thanks, I will take a look. I may need to revert to my original parser scheme which did not use the "preferences": section.

Just so I understand, when first loaded it places you in Kansas; are you using a Tails or VPN to mod your IP?

If you go to Yahoo, set your location on the site, then copy the Address as your URLSite value, what happens on refresh?

Thanks for the info. I was wonder how the site responds from different locations, and thought the first problems would be from other countries and not the USA...

I will do more testing and see if I can find a solution.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5380
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: yahoo.com - Parsing the JSON

Post by eclectic-tech »

SilverAzide wrote: April 4th, 2020, 6:17 pm This is great! Thanks, ET! :thumbup:

The example skin is working, but I am having an issue with the location data.
...
Any ideas?
I updated the package in the first post to use my original parsing scheme. V 1.2020.04.04c

Tested it with locations around the world and is working for me.

I expanded the Date details returned by the measures and corrected some duplicate !UpdateMeasureGroup bangs.

I would be curious if you are still having location problems.

Thanks for the feedback :thumbup:
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm
Contact:

Re: yahoo.com - Parsing the JSON

Post by SilverAzide »

eclectic-tech wrote: April 5th, 2020, 12:05 am I updated the package in the first post to use my original parsing scheme. V 1.2020.04.04c

Tested it with locations around the world and is working for me.

I expanded the Date details returned by the measures and corrected some duplicate !UpdateMeasureGroup bangs.

I would be curious if you are still having location problems.

Thanks for the feedback :thumbup:
Hi, ET! 04c is working perfectly now, thanks! One caveat is when I try the "auto-location" URL it dies due to missing data, which causes the regex to fail. I'm not using a VPN, but I am using a cellular hotspot. I live in a remote third-world country called "Maryland", and some folks can't get wired internet. I think the service provider isn't associating location data with the IP address or something. But no biggie, the important part is that it works when you give it a proper location.

P.S.: When I navigate to the Yahoo website, it gives me the weather in "United States" (i.e., it can't figure out my location either).
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5380
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: yahoo.com - Parsing the JSON

Post by eclectic-tech »

SilverAzide wrote: April 5th, 2020, 5:34 pm Hi, ET! 04c is working perfectly now, thanks! One caveat is when I try the "auto-location" URL it dies due to missing data, which causes the regex to fail. I'm not using a VPN, but I am using a cellular hotspot. I live in a remote third-world country called "Maryland", and some folks can't get wired internet. I think the service provider isn't associating location data with the IP address or something. But no biggie, the important part is that it works when you give it a proper location.

P.S.: When I navigate to the Yahoo website, it gives me the weather in "United States" (i.e., it can't figure out my location either).
Glad to hear you were able to get it working using the 'manual method' even if you live 'off-the-grid' in Maryland! ;-)

Yeah, that's why the google site also placed you in Kansas when the latitude and longitude can not be obtained; they knew you were in the USA, but couldn't tell where...

I'm still seeing what other JSON information might be obtainable (translations, moon data, etc.) but for now it's good to know you have it working.

Thanks for testing! :rosegift:
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5380
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: yahoo.com - Parsing the JSON

Post by eclectic-tech »

Yahoo.com ~ V 1.2020.04.07

Added a variant Yahoo10.com that can show 1 to 10 days of weather (via mouse Scroll)
Added moon phase substitution as string value; still has a number value related to included images

Updated package in first post...
Raidian
Posts: 2
Joined: June 4th, 2020, 5:41 pm

Re: ⭐ Yahoo.com - weather.com alternative

Post by Raidian »

eclectic-tech wrote: April 4th, 2020, 5:05 am This may look familiar... I completely 'stole' JSMorley's 'weather.com' to present this 'yahoo.com' version...

With the passing of the wxdata weather feed, several of us thought we might be able to simply parse the information directly from the https://www.yahoo.com/news/weather/ site.
Is there anyway to get this borderless? Thanks!
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5380
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: ⭐ Yahoo.com - weather.com alternative

Post by eclectic-tech »

Raidian wrote: June 4th, 2020, 5:43 pm Is there anyway to get this borderless? Thanks!
Set 'StrokeWidth' in [MeterAllBackground] to zero.

Code: Select all

[MeterAllBackground]
Meter=Shape
Shape=Rectangle 0.5,0.5,169,334,12 | Fill Color #BackgroundColor# | StrokeWidth 0 | Stroke Color #FrameColor#
X=0
W=170
H=335
Refresh the skin.
Post Reply