Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Lasthenia

macrumors newbie
May 28, 2020
27
10
May have found a small bug in the currency conversion widget. Or it could be the API.

It is showing the "Last Updated" day and month incorrectly. I got this just a while ago:

"Last Updated 18/08/2020 00:05:00"

It is 19/07/2020 00:05:00 where I am which is 12 hours ahead of EDT.
 

Wowfunhappy

macrumors 68000
Original poster
Mar 12, 2019
1,751
2,091
May have found a small bug in the currency conversion widget. Or it could be the API.

It is showing the "Last Updated" day and month incorrectly. I got this just a while ago:

"Last Updated 18/08/2020 00:05:00"

It is 19/07/2020 00:05:00 where I am which is 12 hours ahead of EDT.

So in the process of trying to fix this, I think I figured out how to make a larger improvement which should also work around the problem. Previously, the last update time just came from whenever the widget retrieved data; now it actually comes from the API, which is useful, because exchangeratesapi.io only actually updates once every day (and only on weekdays). This is also closer to how the original widget worked.

Let me know if the problem is gone.

As an aside:

Tried the Weather Widget patch on three systems today. Hung at validating on Snow Leopard, Mountain Lion and Mojave. Currency Unit patch working on Mojave and Mountain Lion, not on Snow Leopard. Same install method on all three.

I originally blamed HTTPS for causing problems, but I was wrong! I neglected to actually look at your screenshot; HTTPS errors would not cause the dropdowns to all display as "Undefined."

I should be able to fix this, but I don't have a Snow Leopard machine to test with atm. Can you please check Snow Leopard's console.app for errors?

Once both these problems are fixed, I'll put together a "full" release with a nice readme. ?
 
Last edited:
  • Like
Reactions: Grom Hellscream

boswald

macrumors 65816
Jul 21, 2016
1,311
2,192
Florida
Although I have no personal use for this, I want to say thank you for your hard work and commitment to the community!
 

Wowfunhappy

macrumors 68000
Original poster
Mar 12, 2019
1,751
2,091
...so, the weatherbit API is starting to really piss me off.

It's become really slow over the past couple of months. I sometimes have to wait several seconds after opening Dashboard before the widget actually updates. And their daily API limit is so absurdly low that I sometimes run into the cap just on my own machine.

I think I'm going to switch APIs again. The HERE api provides 8,000 requests per day, and you only need one API key for both location information and weather information.

The downside is that users on Mountain Lion and below will need to set up a web server with a small PHP proxy script in order for the widget to work, due to HERE's HTTPS requirements. I will include instructions on how to set this up, just like when we used DarkSky. In practice, I don't think there are too many people on such old OS's, and if you are able to set up a web server, the widget will still work even on Tiger!
 
Last edited:

otetzone

macrumors regular
Jul 12, 2019
158
17
True that.
Also noticed that the widget takes a while to refresh. Also, found a weird bug tonight. I live in Israel and for some reason while tonight it's almost the new moon, in Jerusalem it shows full moon. I tried to refresh the location but it wouldn't help. I attach the screenshot here.

ss.jpg
 

Wowfunhappy

macrumors 68000
Original poster
Mar 12, 2019
1,751
2,091
Also, found a weird bug tonight. I live in Israel and for some reason while tonight it's almost the new moon, in Jerusalem it shows full moon.
Thanks! The widget defaults to showing the full moon whenever it isn't provided with proper data. This is how the original widget was coded as well. So if you're seeing the full moon specifically, that's probably what's going on.

If it starts showing other moon phases which are wrong, please let me know.
 

Wowfunhappy

macrumors 68000
Original poster
Mar 12, 2019
1,751
2,091
Believe it or not, tonight Jerusalem and Petah Tikva exchanged the moon phase. Now it's full moon in PT -

Whoops! In that case, ignore what I said yesterday—this is a bug, it must be some kind of rounding error from when I convert the moon phase.

I'll look into it if I decide against moving the whole widget over to HERE.
 

Wowfunhappy

macrumors 68000
Original poster
Mar 12, 2019
1,751
2,091
New beta of the Unit Converter is attached. Someone posted a new currency conversion API to Hacker News today, and I asked if it could be used over HTTP. And they said yes! :D

The JSON format is the same, so it was literally a one-line change. I still need someone on Snow Leopard (or Leopard, or Tiger) to help me do some debugging in order to fix it there.
 

Attachments

  • Unit Converter BETA 2020.07.22.zip
    1.2 MB · Views: 268
Last edited:

Grom Hellscream

macrumors newbie
Jul 20, 2020
2
0
Hi WFH, your work is super-appreciated on the weather widget and the unit converter.

The latest attached file is showing up as damaged for me :(
 

Wowfunhappy

macrumors 68000
Original poster
Mar 12, 2019
1,751
2,091
Hi WFH, your work is super-appreciated on the weather widget and the unit converter.

The latest attached file is showing up as damaged for me :(

Huh. I just re-downloaded the file and it seems to be fine.

...do you have Gatekeeper turned on by any chance? Can you try disabling it just temporarily to see if the problem goes away?

If you're not familiar with the process, you need to run sudo spctl --master-disable in the Terminal. Afterwards, you can re-enable Gatekeeper by opening System PreferencesSecurity & PrivacyGeneral and changing the value of Allow apps downloaded from:, or by re-running the Terminal command with disable changed to enable.

If the weather widget and/or other iterations of the unit converter worked, it would be super odd to only run into this now. But, I do notice the widgets have a _CodeSignature folder, and the files have definitely been tampered with for obvious reasons.
 
Last edited:

broly

Suspended
Apr 1, 2020
64
13
edmonton
Huh. I just re-downloaded the file and it seems to be fine.

...do you have Gatekeeper turned on by any chance? Can you try disabling it just temporarily to see if the problem goes away?

If you're not familiar with the process, you need to run sudo spctl --master-disable in the Terminal. Afterwards, you can re-enable Gatekeeper by opening System PreferencesSecurity & PrivacyGeneral and changing the value of Allow apps downloaded from:, or by re-running the Terminal command with disable changed to enable.

If the weather widget and/or other iterations of the unit converter worked, it would be super odd to only run into this now. But, I do notice the widgets have a _CodeSignature folder, and the files have definitely been tampered with for obvious reasons.

this did the trick for me.
thank you so much for fixing the broken widgets.

it's astounding apple doesn't focus on the little details like this for its desktop users.

your solutions are both robust and elegant while maintaining the stock feel and performance.

keep up the good work!
 

maverick28

macrumors 6502a
Mar 14, 2014
630
312
All is nice but the annoying thing about the weatherbit API is its lagging refreshes. Sometimes to trigger it you need to click "i" on the widget to flip it over, and then click "Done" without changing anything in the location field.
 

Wowfunhappy

macrumors 68000
Original poster
Mar 12, 2019
1,751
2,091
All is nice but the annoying thing about the weatherbit API is its lagging refreshes. Sometimes to trigger it you need to click "i" on the widget to flip it over, and then click "Done" without changing anything in the location field.

Yes, Weatherbit has officially pissed me off enough that I do not want to use them anymore. An update is incoming; I’m already using it on my own machine. Just working on a solution for 10.8 and below.
 

Wowfunhappy

macrumors 68000
Original poster
Mar 12, 2019
1,751
2,091
Okay, so as I alluded to in my previous post this morning, this widget has just gotten another heavy update! I'll admit this project is getting a little ridiculous, but apparently I can't stop working on something until it's perfect. And we're pretty darn close to that point!

Entering your own API key is now optional—the whole thing is now plug n' play. HERE gives us enough calls for free to make this feasible, and I figured out how to use CloudFlare workers—they're pretty cool—to proxy requests so I can keep the built-in key hidden, and keep the widget functional on TLS-1.2-incapable OS's (aka Mountain Lion and older).

Optional instructions for adding your own keys are still included in the download—it's a good thing to set up if you have a few minutes to spare!

The HERE API feels a lot more professional in general, and it allowed me to remove weird hacks and use more of Apple's original code. Knock on wood, this should mean fewer bugs long term—although, since this update constitutes a large change, some problems may reveal themselves in the next few days. Please let me know if you find anything.
 
Last edited:

Wowfunhappy

macrumors 68000
Original poster
Mar 12, 2019
1,751
2,091
I downloaded the fixed version too. Strangely enough, this time it required a restart on all macOSes I use.
I wonder why it doesn't display "Cupertino" on adding a new instance? Would be a nice touch of the old world.
Can you put in a default location of 95014 (Cupertino, CA)?

This will work now. Well, actually, it will automatically detect the closest city, but if that fails it will default to Cupertino.

can't really find Stittsville but is this really that bad?
You'll be able to find Stittsville now.

Edit: Gah, I didn't mean to double post, this was supposed to be an edit to my previous post! Sorry!
 

ellsworth

macrumors 6502a
Jun 13, 2007
925
237
Excellent. I had no idea this widget was broken until I read through this thread and checked myself. Thanks a lot. Apparently, it looks like my STOCKS widget has stopped working as well ;)
 

Wowfunhappy

macrumors 68000
Original poster
Mar 12, 2019
1,751
2,091
Apparently, it looks like my STOCKS widget has stopped working as well

It's not just the stocks widget. :( Flight Tracker, Ski Report, and Translation are also broken. Movies and ESPN still work, but I have to assume they're on borrowed time. (And they're not particularly useful in COVID world.)

I just don't have time to fix all of them—I started working on the Weather widget in February, that's six months ago! I haven't been working on it anywhere near continuously of course, but still, it's a lot of work. I did fix the Unit Converter just because it was super easy; cleaning that up for a proper release is next on the to-do list.
 
  • Like
Reactions: ellsworth

otetzone

macrumors regular
Jul 12, 2019
158
17
You'll be able to find Stittsville now.
Stittsville, MI only. Not Canadian Stittsville. It's still shown as Ottawa.
Not that I don't appreciate your job, I admire it! Just reporting what is up there.
HS here, have inserted my own HERE API to the weather parser.
Wish you'd reach out for the Stock widget one day as well.

Edit: Still takes about 7 seconds to refresh.


4SjckgZ.png
 
Last edited:

Wowfunhappy

macrumors 68000
Original poster
Mar 12, 2019
1,751
2,091
Stittsville, MI only. Not Canadian Stittsville. It's still shown as Ottawa.

Ah, okay, sorry! Out of curiosity, what happens if you type in your street address?

Edit: Still takes about 7 seconds to refresh.

Oh no! HERE is basically instant for me, so I really thought it would be fast everywhere. How long is it taking for other people?

Also, that HERE logo is in the wrong place, I wonder if that's because you're on High Sierra. I made a point of testing Tiger but I didn't test 10.13 or 10.14. Looks like I have a bit of work left to do...
 
Last edited:

otetzone

macrumors regular
Jul 12, 2019
158
17
Out of curiosity, what happens if you type in your street address?
Lipizzaner St. returns Ottawa, ON.

The widget is working differently on Mavericks and High Sierra. On Mavericks Jerusalem returns HaKnesset on the face and Ottawa returns Healey's Heath on the face while it's Jerusalem and Ottawa on HS.
I will update on how quick it would refresh itself on Mavericks.

Jerub.png

Jeruf.png


ottab.png

ottaf.png


For some reason the first day has already changed itself to FRI under Mavericks while it still stays THU on HS.
It seems that the results for Stittsville on Mavericks are also different from HS.

stitts.png


Update: The widget updates pretty quick on Mavericks compared to HS, however I noticed that the temperature given is different on either OSes. On HS it states 29 C for Jerusalem while it's reporting 33 C on Mavericks.
I entered my HERE API to the parser file and saved it and then just tossed it over to the 10.9 machine. I wonder whether I had to do that since you said the widget would work out of the box anyway.
 
Last edited:

Lasthenia

macrumors newbie
May 28, 2020
27
10
The "Last Updated" date for currency in the Unit Converter widget BETA is now stuck at 26/07/2020 for me.

Worked fine for a few days but does not update any more.
 

Wowfunhappy

macrumors 68000
Original poster
Mar 12, 2019
1,751
2,091
I noticed that the temperature given is different on either OSes. On HS it states 29 C for Jerusalem while it's reporting 33 C on Mavericks.

Hm, did you put in your location exactly the same way? For example, did you put in your street address on High Sierra, but just type in "Ottawa" on Mavericks? I programmed the widget such that if you give it more precise information, it will use that extra information, even if both come up as the same city. I'm realizing now that this is a bit confusing, I wonder if there's a better way to handle it...

I wonder whether I had to do that since you said the widget would work out of the box anyway.

It will work out of the box, but I do appreciate you using your own key. I'm a little worried about the shared key getting used up—it depends on how many people are actually using the widget, which I've had no insight to up until now.

No idea what's going on with update speed, still need to do some testing in a High Sierra VM...

Edit: I just had another thought. Do me a quick favor—on both machines, delete Library/Preferences/widget-com.apple.widget.weather.plist, then reboot. It may do nothing, but I wonder if it's pulling in saved data from the old version.

Edit2: Grr, and I can't seem replicate your issues in High Sierra. :( Everything works fine, down to the HERE logo on the back...
 
Last edited:

otetzone

macrumors regular
Jul 12, 2019
158
17
Do me a quick favor—on both machines, delete Library/Preferences/widget-com.apple.widget.weather.plist, then reboot.
It worked beautifully, thank you! HaKnesset still stayed for Jerusalem, however typing in "stittsville" in the search field, while choosing Ottawa for the only result in the list now gives Old Stittsville on the face! Refreshes very quick. Checked on both machines. The temperatures are the same for each city. And the HERE logo on HS machine is located correctly now. Sorry for panic.

UPD. It does use the address to find the nearest spot, pretty cool feature!
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.