Widget Examples

(Sorry for spamming so much about an AdGuard widget on here, but I promise I’ll try and remove this stuff after I’ve gotten the widget)

So, If anyone can make a widget for AdGuard that looks like this, that would take you too the AdGuard app (scheme URL: adguard-pro:// or adguard:// ), I would be very thankful!!! (Umm… dark mode is preferred, and I’m hoping that the buttons and Color of the icons would change according to the status if it’s on or off)

I just want to say thanks for posting this, and for structuring and documenting it so beautifully — I feel like am learning more Javascript reading through this than I have in all my fumbling about with StackOverflow etc. for the last few months.

Edit: I mean, this line alone is worth a beer — I can think of all kinds of applications for it.

const eventsAreVisible = (futureEvents.length > 0) && (numberOfEvents > 0)

3 Likes

That is wonderful to hear. I am definitely learning as I go as well – one reason I document so heavily is to make sure I understand what’s going on. Also, Javascript is just such a fun and expressive language too.

And trust me that line of code came at the end of hours of strife trying to figure out some bugs!

It looks amazing. I tried to put it in my phone (iphone 7) and found the space is not enough if there are 3 events shows on the medium widge.But thanks for your great notes in the code, I modified according it and got a perfect result.

4 Likes

Welcome @Lewis_Gale. I’m afraid you don’t show the offending line.

Sorry I’m still new to all of this, and trying to learn. What do you mean by that?

He means in your screenshot you did not show the line that caused the error.

1 Like

Ah my bad, here is a screenshot.
Also if it helps… it’s for the Apple event countdown script.

1 Like

Thank you. So it looks like the parameter you passed into createRelativeTime - namely date - is null. In this case there’s something wrong with eventDate - which gets created in line 16. Possibly because you create it with no parameters i.e. no date.

Thank you for getting back to me and helping, just one last thing, what would you say to put in there?

Sorry that I’m a newbie.

Hi there,

I’d like ask too how to change language of the widget

Did you get the dark mode working? Are you able to share the complete code of the revised widget?

I’m sorry, I’ve no idea. Hopefully others can help. What date did you want in there? Today? Yesterday?

Here’s a couple of widgets showing stats for YouTube channels.

Channel subscribers

Here’s an example for a channel with a few more subscribers

Recent channel uploads

(FYI: I am working on improving the design for this widget at the moment)

Find the code at my GitHub repo: https://github.com/mrmartineau/scriptable-widgets/tree/main/YoutubeChannelStats

Also, while you’re here, please checkout my brother’s new YouTube channel: A Good Chew. I made these widgets for him.

3 Likes

I don’t think that it is possible .

Is there any api to check which settings are enabled ?

Sorry, I’m a noob. I don’t get what you mean by api… do you mean the app scheme URL?

He means a place where your settings is stored and can be retrieved for widget settings.

Oh. I don’t know how to get that.

Your Widget is so beautiful ,Can your share your code?

Hmm… how about the way that the Shortcuts application can open urls? Can Scriptable open it like that, except with an image with buttons over it?