Desktop X Weather Widgets not functioning

Lost functionality

Monday, March 11, 2019 by Chasbo | Discussion: OS Customization

My DX weather widgets stopped working. This has happened before in years past. I don't know of a solution. 

First Previous Page 2 of 3 Next Last
Vad_M
Reply #21 Monday, September 9, 2019 7:53 PM

RedneckDude

Function Object_OnLButtonUp(x,y,dragged)

Thank you, but it's night around me so I'll fix this Function Tomorrow.

Vad_M
Reply #22 Tuesday, September 10, 2019 4:21 AM

Hi Jim,

It seems to me that this is one of the first Functions created by Martin many years ago... This function requires an unambiguous spelling of City Name. That is, you must enter “New York, NY” to receive the correct data. Otherwise, if you just enter "New York", you will see 10 different places around the World... I don’t like this...

Naturally, my previous advice was incorrect, because it implied a different method to receive the weather data. So your fix here:

You need change the string:

"http://xml.weather.com/search/search?where=" & x, False

to:

"http://wxdata.weather.com/wxdata/search/search?where=" & x, False

So the working function should be:

Function Object_OnLButtonUp(x,y,dragged)
If dragged = False Then
x = DesktopX.ScriptObject("weather_image").location
If IsNumeric(x) = False Then x = Object.Text
x = InputBox("Please enter the zip code or location that you would like to display the weather for:" & vbNewLine & "e.g. 48152 or York,England", "Select location ...", x)
If IsNumeric(x) = False Then
Set http = CreateObject("Microsoft.XmlHttp")
Randomize
str_RANDOM_URL="&rnd=" & rnd()
http.Open "GET", "http://wxdata.weather.com/wxdata/search/search?where=" & x, False
http.send ""
' Store data in a string
weatherdata = http.responseText
If InStr(weatherdata, "loc id") > 0 Then
weatherdata = Right(weatherdata, Len(weatherdata) - InStr(weatherdata, "loc id") - 7)
weatherdata = Left(weatherdata, InStr(weatherdata, "type") - 3)
x = weatherdata
End If
End If
If x <> "" Then
DesktopX.ScriptObject("weather_image").location = x
DesktopX.ScriptObject("weather_image").Object_OnTimer6001
End If
End If
End Function

By the way, you can easily check how this works before applying the fix to your code. Just open a new tab in your browser and paste something like this to the address field:

http://wxdata.weather.com/wxdata/search/search?where=New York, NY

Then press Enter and you will see the result.

Have a nice Day!

P.S. If your widget still does not work, change the URL inside the

DesktopX.ScriptObject ("weather_image")

to one of my previous post. I think you will find the right place here:

Sub Object_OnTimer6001.

RedneckDude
Reply #23 Tuesday, September 10, 2019 2:57 PM

Aaaarrgghhh. I'm no scriptor. Still can't get it to work.

 

I'd rather use one of my own weather widgets, but they crash on load.  May I send you one of mine to fix, and I can take it from there to fix others?

Vad_M
Reply #24 Tuesday, September 10, 2019 4:48 PM

RedneckDude

I'd rather use one of my own weather widgets, but they crash on load. May I send you one of mine to fix, and I can take it from there to fix others?

Yes of course! You may send it. Or just give me a link to the gallery of your widgets, and I will download it myself. Today I already tried to download and check a few pieces, but they all work through Weather Underground.  So I couldn’t find at least one working with TWC.

Don't worry.  Anyway your widgets will work.

Vad.  

P.S. Widgets crash on load due to fatal errors in their scripts. Just close DesktopX, turn off the Internet before opening the buggy widget, and it will open without crashing.

RedneckDude
Reply #25 Tuesday, September 10, 2019 5:50 PM

https://www.wincustomize.com/explore/desktopx_widgets/2384/

 

There's one. If you fix it, I can fix the rest.  Thanks.

Vad_M
Reply #26 Tuesday, September 10, 2019 6:14 PM

RedneckDude

There's one.

I installed DX 4.0. But there is one problem... look at your PM. The DesktopX Builder.exe is MISSING!!! How I can edit the widget???

Vad_M
Reply #27 Tuesday, September 10, 2019 6:15 PM

I uninstalled DesktopX 4.0. Then installed my old DesktopX 3.50. Works great. That was good news. And now the bad ones...

I can’t fix your widget because it works through the WEATHER UNDERGROUND. I need the widget from which you got this function:

RedneckDude

Function Object_OnLButtonUp(x,y,dragged)
If dragged = False Then
x = DesktopX.ScriptObject("weather_image").location
If IsNumeric(x) = False Then x = Object.Text
x = InputBox("Please enter the zip code or location that you would like to display the weather for:" & vbNewLine & "e.g. 48152 or York,England", "Select location ...", x)
If IsNumeric(x) = False Then
Set http = CreateObject("Microsoft.XmlHttp")
Randomize
str_RANDOM_URL="&rnd=" & rnd()
http.Open "GET", "http://xml.weather.com/search/search?where=" & x, False
http.send ""
' Store data in a string
weatherdata = http.responseText
If InStr(weatherdata, "loc id") > 0 Then
weatherdata = Right(weatherdata, Len(weatherdata) - InStr(weatherdata, "loc id") - 7)
weatherdata = Left(weatherdata, InStr(weatherdata, "type") - 3)
x = weatherdata
End If
End If
If x <> "" Then
DesktopX.ScriptObject("weather_image").location = x
DesktopX.ScriptObject("weather_image").Object_OnTimer6001
End If
End If
End Function

RedneckDude
Reply #28 Tuesday, September 10, 2019 10:34 PM

Vad, builder hasn't been around for a good while.  Check your PM.

 

Vad_M
Reply #29 Wednesday, September 11, 2019 4:58 AM

RedneckDude

Vad, builder hasn't been around for a good while

The problem was solved. Everything works fine, so forget about these trifles...  

Please, give me a link to download any widget which works with weather.com and uses the function from Reply #27.

I cannot fix any other scripts because it takes too long to study how they work...

Vad_M
Reply #30 Wednesday, September 11, 2019 6:15 AM

Here is the link to the fixed Stardock's Silica Weather widget:

https://www.sendspace.com/file/hqrwrt

I did this a few minutes ago. You may see how it work now.

RedneckDude
Reply #31 Wednesday, September 11, 2019 2:03 PM

Sorry Vad, I'm not putting a credit card into a "free" account in order to get this file.

 

Edit:, after closing and reopening the page it let me download for free.

Vad_M
Reply #32 Wednesday, September 11, 2019 3:34 PM

RedneckDude

Edit:, after closing and reopening the page it let me download for free.

Damn scammers! They talked about a free service!  Hmm... In the Firefox, it doesn't ask for a credit card... Anyway I'm sorry.  

So I decided to post the fixed code here to bypass any uploads/downloads.

1. The part of Function from DesktopX.ScriptObject ("weather_location") (it searches for a TWC weather code by Location Name):

Function Object_OnLButtonUp(x,y,dragged)
If dragged = False Then
x = DesktopX.ScriptObject("weather_image").location
'If IsNumeric(x) = False Then x = Object.Text
x = InputBox("Please enter the zip code or location that you would like to display the weather for:" & vbNewLine & "e.g. 48152 or York,England", "Select location ...", x)
If IsNumeric(x) = False Then
Set http = CreateObject("Microsoft.XmlHttp")
Randomize
str_RANDOM_URL="&rnd=" & rnd()    '<---  HERE IS YOUR FIX --->
http.Open "GET", "http://wxdata.weather.com/wxdata/search/search?where=" & x, False
http.send ""
' Store data in a string ..........................................................................................................................................................................
End Function

As you see, we have already dealt with this Function.

2. The part of Subroutine from DesktopX.ScriptObject ("weather_image") (it retrieves and analyzes the weather data):

Sub Object_OnTimer6001
If location <> "" And location <> "Not found" Then
If System.InternetConnected Then
On Error Resume Next
' Create a web object
Set http = CreateObject("Microsoft.XmlHttp")
' Retrieve data
Randomize
str_RANDOM_URL = "&rnd=" & rnd()
If tempunit = "m" Then
str_UNITS = "&unit=m"
Else
str_UNITS = "&unit=s"
End If   '<---  HERE IS YOUR FIX --->
http.Open "GET", "http://wxdata.weather.com/wxdata/weather/local/" & location & "?cc=*&dayf=5" & str_UNITS & str_RANDOM_URL, False
http.send ""
' Store data in a string.............................................................................................................................................
End Sub

That's all. Just change these two lines in your code and any widget received data from weather.com will work without errors.

Good luck and Happy Coding  

Vad_M
Reply #33 Thursday, September 12, 2019 4:32 AM

I found why some widgets/gadgets stopped working. Please look here:

End of Service for the Weather Underground API

Sad news...  

RedneckDude
Reply #34 Thursday, September 12, 2019 8:31 PM

I don't mean to whine, but the Silica weather has an issue where you have to set city every time you load it. It doesn't remember the city you set.

RedneckDude
Reply #35 Thursday, September 12, 2019 8:32 PM

Sviz scripts created a folder on the PC that would contain items to cause it to remember the location.

Vad_M
Reply #36 Friday, September 13, 2019 4:36 AM

RedneckDude

I don't mean to whine, but the Silica weather has an issue where you have to set city every time you load it. It doesn't remember the city you set.

Jim, my goal was to fix the widget’s access to the weather forecast, and I did it. Nothing more. I don’t even know where and how this Silica stores location records...

I can and I am ready to help. But I cannot do your work in your place. These are your widgets and only you know how they should work. Not me.


Please give me a link to any of your old widgets that worked with weather.com (not through WU). I will fix this widget and you will use it as a template.
Or you can do it yourself using the instructions from: Reply #32

Vad.

P.S. Here are a few other working widgets: Widget Examples.zip

RedneckDude
Reply #37 Friday, September 13, 2019 12:54 PM


Jim, my goal was to fix the widget’s access to the weather forecast, and I did it. Nothing more. I don’t even know where and how this Silica stores location records...

I can and I am ready to help. But I cannot do your work in your place. These are your widgets and only you know how they should work. Not me.

 

Oh, Vad, that wasn't aimed at you. Sorry.  it was a general rant/bitch about the way things work. I didn't expect you to fix it, though I was hoping someone would have an answer.

 

I can't code, so, I guess it is what it is.

 

I appreciate the fixing of Silica, at least now I have a template.

RedneckDude
Reply #38 Friday, September 13, 2019 12:57 PM

All (if I recall correctly) of my widgets are using WU, as that is the script that Sviz used.  I will just likely delete all my non working weather, and not upload weather anymore due to the fickleness of the feeds.  I MIGHT use silica as a template for future skins.

RedneckDude
Reply #39 Friday, September 13, 2019 1:01 PM

Thank you for the examples, Vadim.

Vad_M
Reply #40 Friday, September 13, 2019 2:03 PM

RedneckDude

All (if I recall correctly) of my widgets are using WU, as that is the script that Sviz used.

There is an easy way to check the widget in the DX List Objects (turn off the Internet earlier!!!). The widget is not editable if you will see any objects with "WU ..." in their names. But if you will see an object like "weather_image", "weatherimage", etc... this is what you need.

RedneckDude

Thank you for the examples.

Hi Jim,

All widgets in the "Examples" based on _Martin_ script. I think that the easiest way for you would be to use one of adni's widgets, because GT3 writes data to the Windows registry, which is not very good. Adni's widgets also have fewer objects and features, which makes them easier to use as example.

Good Luck!  

P.S. There is no doubt that in a few days your widgets will work again!

 

Please login to comment and/or vote for this skin.

Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:

  • Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
  • Access to a great community, with a massive database of many, many areas of interest.
  • Access to contests & subscription offers like exclusive emails.
  • It's simple, and FREE!



web-wc01