5

I fixed Apple's broken Weather Dashboard Widget

 2 years ago
source link: https://forums.macrumors.com/threads/i-fixed-apples-broken-weather-dashboard-widget.2225715/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

I fixed Apple's broken Weather Dashboard Widget

Wowfunhappy

macrumors 65816

Original poster

Mar 12, 2019

1,269

1,510

Download: https://jonathanalland.com/old-osx-projects.html

---

The Weather dashboard widget that ships with Mac OS X 10.4 – 10.14 broke in 2019, when the APIs it uses went offline. Luckily, the widget is all just editable Javascript code, so I rewrote a portion of the code to use the freely-accessible DarkSky and MapQuest APIs. Then I rewrote it again a few months later to use the Weatherbit API after Apple bought DarkSky, and again after getting frustrated with Weatherbit.

Previous versions of this widget required you to add your own API keys, but this is no longer necessary—just download and run! (Optional instructions for adding your own key are still included in the download; it's a good thing to set up if you have a few minutes to spare.)

This widget has been explicitly tested on 10.4 "Tiger", 10.6 "Snow Leopard", 10.9 "Mavericks", and 10.13 "High Sierra", but it should run on Tiger through Mojave. Please let me know if it does not.

Please also post if you encounter problems, notice something wrong, or just find something that could be improved.
Last edited: Jan 5, 2022

blikum

macrumors newbie

Dec 20, 2006

So far, so good. I made the background images transparent, I like the way it looks better. Once again thank you, thank you, thank you for all of the great work!
Screen Shot 2020-03-06 at 11.58.18 AM.jpg

Stephen.R

Suspended

Nov 2, 2018

4,356

4,732

Thailand

It's been a while since I used a Dashboard widget, but might I suggest that the credentials required for the APIs could be entered on the 'back' of the widget, where you enter your preferred location?

Wowfunhappy

macrumors 65816

Original poster

Mar 12, 2019

1,269

1,510

It's been a while since I used a Dashboard widget, but might I suggest that the credentials required for the APIs could be entered on the 'back' of the widget, where you enter your preferred location?
I thought about it. The primary issue is that including a dialog for the API key inside the UI would pretty clearly violate DarkSky's rules. By contrast, I figure there's nothing to stop me from essentially distributing source code and providing instructions on how to finish it.

I also had some design concerns about putting too many fields on the back. I didn't want to ruin Apple's design, and as-is, I fretted for a long time about how to position the DarkSky logo.
Last edited: Mar 6, 2020

Reactions: gdwarner

Stephen.R

Suspended

Nov 2, 2018

4,356

4,732

Thailand

Ah, I didn't realise it was specifically a developer key that's required.

Reactions: gdwarner

Mr_Brightside_@

macrumors 68040

Sep 23, 2005

3,579

1,762

Toronto

So cool. Working well in Toronto Ontario.
[automerge]1583518429[/automerge]
I can try on a Tiger machine this weekend!

Reactions: gdwarner

Valery2020

macrumors newbie

Mar 3, 2020

Київ

Does not work

Attachments

  • index.png
    index.png
    758 KB · Views: 438

Reactions: David G.

Wowfunhappy

macrumors 65816

Original poster

Mar 12, 2019

1,269

1,510

Oh, phew, the widget isn't broken, you’re just having trouble obtaining a key.

Can you do as they say, and try generating a key again later? Maybe they're having a server blip.
Last edited: Mar 6, 2020

Reactions: gdwarner

blikum

macrumors newbie

Dec 20, 2006

Seems to work fine for me, but it doesn't seem to update. Mine still says 55 and sunny outside, but it's night time and in the 30's.

Reactions: gdwarner

Wowfunhappy

macrumors 65816

Original poster

Mar 12, 2019

1,269

1,510

Seems to work fine for me, but it doesn't seem to update. Mine still says 55 and sunny outside, but it's night time and in the 30's.
That's not good! If you search for "Weather" in the console, do any Javascript errors come up?

What happens if you reload the widget? (make sure the widget is in focus and then cmd+r)

Valery2020

macrumors newbie

Mar 3, 2020

Київ

No((((

Attachments

  • Снимок экрана 2020-03-07 в 18.04.52.png
    Снимок экрана 2020-03-07 в 18.04.52.png
    333.8 KB · Views: 310

blikum

macrumors newbie

Dec 20, 2006

That's not good! If you search for "Weather" in the console, do any Javascript errors come up?

What happens if you reload the widget? (make sure the widget is in focus and then cmd+r)
No errors in console. When I refresh it does fetch the current conditions. It just seems like it's not refeshing on it's own.

Wowfunhappy

macrumors 65816

Original poster

Mar 12, 2019

1,269

1,510

No((((
Can you try changing... anything possible about the machine you use to get the keys? Different browser, different device, different network, different physical location, etc.

You'll only ever have to do this once.
No errors in console. When I refresh it does fetch the current conditions. It just seems like it's not refeshing on it's own.
Okay, so presumably the function startFetchDataTimer() isn't running. You're in Wake Forest, NC, right? Going to see if I can reproduce the problem with that location.

blikum

macrumors newbie

Dec 20, 2006

Can you try changing... anything possible about the machine you use to get the keys? Different browser, different device, different network, different physical location, etc.

You'll only ever have to do this once.

Okay, so presumably the function startFetchDataTimer() isn't running. You're in Wake Forest, NC, right? Going to see if I can reproduce the problem with that location.
Yes, Wake Forest, NC. Thanks for helping.

Wowfunhappy

macrumors 65816

Original poster

Mar 12, 2019

1,269

1,510

Sigh, so now another user is also having issues getting a MapQuest key. Then I did a small amount of Googling, and it looks like lots of people are having this problem:

Can't get API Key

This error occurs whenever I try to get a free api key ' Error while trying to accept TnCs. Please try again later. There was a problem accepting the Free rate plan. Please try again later.'

developer.mapquest.com

developer.mapquest.com

The issues appear to have (quite coincidentally) begun yesterday. Unfortunate, but presumably they'll fix it, let's just wait a bit.

If anyone knows of a better Geocoding API, please feel free to suggest it.

Wowfunhappy

macrumors 65816

Original poster

Mar 12, 2019

1,269

1,510

Yes, Wake Forest, NC. Thanks for helping.
Huh, that location is updating for me.

There's no reason this should do anything whatsoever, but just before I go crazy—can you try restoring the original weather widget without your transparency changes, to make sure the problem still happens?

Also, what OS are you running?
Last edited: Mar 7, 2020

blikum

macrumors newbie

Dec 20, 2006

You know what? It's working for me too now. When I got up today, it was the same temp as last night, it didn't update. I'm on 10.10.5 I'll keep an eye on it and let you know what happens.

Wowfunhappy

macrumors 65816

Original poster

Mar 12, 2019

1,269

1,510

Because MapQuest is currently having problems, please send me a PM if you need a MapQuest key. Please note:
  1. Everyone who PM's me will get the same key. Please don't abuse the key by using it elsewhere. I will need to revoke the key if usage is too high.
  2. Regardless of usage, I will revoke this key as soon as I get hear that MapQuest has fixed their problems. At this time, you will need to go through the process to acquire and add your own key, or else the widget will stop working when you next change your location.
Thanks!

Sounds like this is fixed now!
Last edited: Mar 8, 2020

Mr_Brightside_@

macrumors 68040

Sep 23, 2005

3,579

1,762

Toronto

I was having some issues with the widget on High Sierra, but a killall Dock in a Terminal cleared them up!
No issues with my MQ API key.

maxx1

macrumors newbie

Mar 7, 2020

Because MapQuest is currently having problems, please send me a PM if you need a MapQuest key. Please note:
  1. Everyone who PM's me will get the same key. Please don't abuse the key by using it elsewhere. I will need to revoke the key if usage is too high.
  2. Regardless of usage, I will revoke this key as soon as I get hear that MapQuest has fixed their problems. At this time, you will need to go through the process to acquire and add your own key, or else the widget will stop working when you next change your location.
Thanks!
Can you share the MapQuest key in a public message?
Thank you!

kretek

macrumors regular

Oct 15, 2008

Worked for me after restart.

Wowfunhappy

macrumors 65816

Original poster

Mar 12, 2019

1,269

1,510

Can you share the MapQuest key in a public message?
Thank you!
Nope, if I could do that, I wouldn’t have asked you to PM me.
Last edited: Mar 7, 2020

Erehy Dobon

Suspended

Feb 16, 2018

2,161

1,996

No service

As of 8am PDT today Sunday 8 March 2020, the Mapquest developer site was generating API keys normally.

I generated mine and edited the JS parser file per the instructions.

The widget works great here in California.

Thanks to Wowfunhappy for his hard work!

tosbsas

macrumors 65816

Nov 22, 2008

1,051

Lima, Peru

Thats for catalina too?

Wowfunhappy

macrumors 65816

Original poster

Mar 12, 2019

1,269

1,510

Thats for catalina too?
No, sorry! This is just a modified dashboard widget that will keep receiving new weather information now that the original servers have gone down. You still need to be running an operating system that has the dashboard, aka 10.4 – 10.14. In Catalina, the dashboard is completely gone!

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK