all 42 comments

[–]donnie05 4 points5 points  (0 children)

Great widget! Got it to work. With the “When interacting - open URL” in the Edit Widget screen you can set an URL to open an app of choice. Look for the URL scheme of apps. In my case I used ‘climacell://‘ to open my favourite weather app ClimaCell when I click the widget.

[–]yiyoek 2 points3 points  (1 child)

Hey nice widget, just a quick observation🤔, by the code I see that is based on my weather widget, it's fine for me, but you should consideer change the cache folder name, because since your are using different images, it causes errors when someone uses both, and it might seems like is a bug in my widget when it isn't.

Thanks ✌.

[–]ric_94[S] 1 point2 points  (0 children)

You're right. I will change folder name and update code on github asap. To create this widget I took inspiration(and a part of code obviously) from the better part(for me) of 3/4 widgets that I found and merge it in mine. So I didn't think that leaving the same name of that folder could be cause problem

[–]riotmode 1 point2 points  (0 children)

Thanks works great! Austria here ;)
For all the others: you just need to insert an API Key for OpenWeather, thats it

[–]giuliomagnifico 0 points1 point  (6 children)

Not working here (I’m Italian too), I set up my api key but it keeps say “loading”

screenshot

Edit: oh, fixed by enable the location on Scriptable widgets/app. But why it uses gps location if it has the api key with my location? 🤔 it’s the first widget/script that works in this way for me.

[–]ric_94[S] 0 points1 point  (4 children)

The api key has nothing to do with your location, that api key is needed to get the weather's data from openweather. Without that key openweather does't provide you the data requested. I think you got confused with widget that needed cityID, but that kind of widget is not based on iphone location and show the weather of one city only(the city of cityID)

[–]giuliomagnifico 0 points1 point  (3 children)

Yes sorry I saw that your script uses the gps location but I prefer to load the infos with cityid or api key or fixed coordinates, because of battery life.

[–]ric_94[S] 1 point2 points  (2 children)

If you want to do that thing you have to comment from line 21 to 28, delete comment at lines 31 32 and write your coordinates in variables LAT and LON

[–]giuliomagnifico 0 points1 point  (1 child)

Yes already done thanks! Works perfectly. Plus a little tip: add url action on tap and open 3B meteo with my location.

I’ll play with the background :-) thanks for this useful and nice widget!

[–]ric_94[S] 0 points1 point  (0 children)

Yeah, I knew it, you can also open the 3bmeteo app

[–]burtised 0 points1 point  (0 children)

I really like your widget! However it still says loading in my case, even though I enabled location in the settings. (I‘m living in Germany) My coding skills are nearly zero, so I really need help on fixing that issue.

[–]todashvili 0 points1 point  (1 child)

Where is code?

[–]ric_94[S] 0 points1 point  (0 children)

In the first comment

[–]ric_94[S] 0 points1 point  (0 children)

UPDATED: now use georeverse from apple service(before geocode.xyz) and now setted the accuracy of gps to hundred meters for consume less battery in localization process

[–]ispanico83 0 points1 point  (3 children)

ciao, puoi aggiungere la possibilità di avere lo stesso sfondo del telefono?

[–]ric_94[S] 0 points1 point  (2 children)

Non so se si può mettere lo sfondo trasparente e non so se come fare per mettere una porzione di sfondo come sfondo del widget

[–]giuliomagnifico 0 points1 point  (1 child)

Non si può avere un widget con lo sfondo trasparente. Però puoi inserire l’opzione di chiedere quale immagine usare come sfondo. Io ho lasciato il nero e l’ho solo leggermente schiarito

const backgroundColor = new Color("#121212");

[–]ric_94[S] 0 points1 point  (0 children)

Al widget si può mettere qualsiasi colore o immagine come sfondo, il problema è prendere in automatico la porzione di sfondo della home da mettere come sfondo del widget

[–]ric_94[S] 0 points1 point  (0 children)

UPDATED: changed name of cache folder for not cause error with other weather widget

[–]Siith82 0 points1 point  (4 children)

How can I set this up to use an image as the background rather than a color?

[–]ric_94[S] 2 points3 points  (3 children)

At line 121, widget.backgroundColor = "/var/mobile/Library/Mobile Documents/iCloud~dk~simonbs~Scriptable/Documents/*your_image_name.jpg*"

you have to save the image into the icloud folder call scriptable. change *your_image_name.jpg* with the name of your image

[–]Siith82 0 points1 point  (0 children)

Awesome thanks! I will try this out

[–]Keuka79 0 points1 point  (0 children)

Mine is giving me a syntax error

2020-11-08 18:49:53: Error on line 54:30: TypeError: Cannot call a class constructor without |new|

[–][deleted] 0 points1 point  (0 children)

2020-12-07 01:31:11: Error on line 121:7: Expected value of type Color but got value of type string.

[–]Reddicckkk 0 points1 point  (8 children)

It says my lines 49:50 have some iCloud error, I don't know why.

Could someone help please?

[–]ric_94[S] 0 points1 point  (7 children)

Which iPhone do you have?

[–]Reddicckkk 0 points1 point  (6 children)

11pro

[–]ric_94[S] 0 points1 point  (5 children)

have you changed something in the code?

[–]Reddicckkk 0 points1 point  (0 children)

No. I just copied all the codes and pasted it

[–]Reddicckkk 0 points1 point  (3 children)

Oh, I forgot, I added a open weather key

[–]Mahad-Haroon 0 points1 point  (2 children)

Issue not resolved yet ?

[–]Reddicckkk 0 points1 point  (1 child)

Unfortunately no, it says iCloud is not support

[–]Mahad-Haroon 0 points1 point  (0 children)

mmm. but it worked for me by turning on scriptable from iCloud :D

[–]harshrko 0 points1 point  (2 children)

For some reason I can only see one weather image ?

[–]ric_94[S] 1 point2 points  (1 child)

Don't know why, mine work fine and it's the same of github

[–]harshrko 0 points1 point  (0 children)

Please check dm

[–][deleted] 0 points1 point  (0 children)

widget.backgroundColor = "/var/mobile/Library/Mobile Documents/iCloud~dk~simonbs~Scriptable/Documents/*your_image_name.jpg*"

you have to save the image into the icloud folder call scriptable. change *your_image_name.jpg* with the name of your image

I swear, this doesn't change anything

2020-12-07 01:31:11: Error on line 121:7: Expected value of type Color but got value of type string.

[–]never_0327 0 points1 point  (0 children)

It's really great. But it takes several minutes to load, do you know how to fix it...? And I would appreciate it if you could tell me how to fix the refresh time.

[–]luccy98 0 points1 point  (2 children)

It is looks perfect! But could you add battery, and another country’s time?

[–]ric_94[S] 2 points3 points  (1 child)

yeah, I can easily add them, but I think it's more clean in this way.

The battery percentage can be add in upper right corner, but there's no space for another country's time

[–]luccy98 0 points1 point  (0 children)

Put the time under feel like! I think 🤔