Widget to display an image file from a fixed url, with auto-refresh every xx seconds?

I have a fixed URL of the snapshot from my webcam. The snapshot will be automatically updated every 30 seconds by my shell script on my ubuntu. If I would like to display it as a widget on my iPad with an automatic refresh every 30 seconds, by using Scriptable. How the script would look like?

Thank you

Refresh of widgets is controlled by the OS, not the app defining them. The only exception I think is when the app is a clock, but I may be misremembering that exception. The refresh is based on availability of resources and some other factors, but in the current functionality from Apple, your wish isn’t possible.

Thanks. In such a case, any sample script I could follow to display an image from a fixed URL?

Here’s a very basic example:

let req = new Request('http://your/url/image.jpg');
let image = await req.loadImage();
let widget = new ListWidget();
widget.addImage(image);
Script.setWidget(widget);

And there is no way of forcing refresh by invalidation? (Whatever “invalidation” might mean.) I guess not.

The only ways I know of to force a refresh are by rerunning the script or by running Scriptable’s “Refresh all widgets” action in a shortcut. It might be a candidate for a background automation in MFC Deck, but I’m just guessing since I haven’t really explored that feature of MFC Deck.

1 Like