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?
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.
let req = new Request('http://your/url/image.jpg');
let image = await req.loadImage();
let widget = new ListWidget();
widget.addImage(image);
Script.setWidget(widget);
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.