Data source for weather widget?

What is the data source for the weather widget?

(How) can I open an app or web page with more detailed info for the same location and time, when pressing the weather widget (which by default seems to have no action defined)?

It's using the DarkSky API: https://darksky.net/

You can assign the open URL predefined action to open that website.

Thanks! That's what I hoped and suspected, given the accuracy. But generating the URL to take the location into account seems tricky. Mine looks like https://darksky.net/forecast/NN.NNN,-NN.NNN/us12/en with the N's replaced by digits of the decimal latitude and longitude; and I have no idea where us12 comes from.

I'd hope to be able to put in a URL that would change with my current location, as the widget itself does. If there were tokens I could embed in the URL, I wouldn't have to come up with a way to generate the variable parts of the URL myself.

Good evening

"us12" means us units and 12 hour time format. It seems to be the default for if nothing else is chosen.

I do exactly this on press, you need to add an action for the press in BTT and make it run apple script, here is my script:

tell application "Location Helper"
set clocation_coords to get location coordinates
end tell

set longitude to item 1 of clocation_coords
set latitude to item 2 of clocation_coords

tell application "Google Chrome"
activate
open location "https://darksky.net/forecast/" & longitude & "," & latitude & "/si12/en"
end tell

You'll need to download location helper form the app store

Oh and as you can tell I use 'SI' units ie the si12, change as you want

1 Like

You can also do

tell application "BetterTouchTool"
	set clocation_coords to get_location
end tell

tell application "Google Chrome"
	activate
	open location "https://darksky.net/forecast/" & clocation_coords & "/si12/en"
end tell

Then it will not need the helper tool

2 Likes

Thanks, just what I wanted!

Thanks for that info. Much as I prefer familiar units (I don't know what Celsius temperatures feel like without converting, although I'd have a rough idea if I used them more), I have dealt with 24 hour time enough to be happier with that, so I changed that part to us24 and got the expected result.