Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
An iPhone widget, that shows you a live webcam image from on your homescreen
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: blue; icon-glyph: camera-retro;
// Script by Andreas Redeker <>
let param = args.widgetParameter
let url
if (param != null && param.length > 0) {
url = param
} else {
url = ""
const imgUrl = url + "current/400.jpg"
const imgReq = await new Request(imgUrl)
const img = await imgReq.loadImage()
if (config.runsInWidget) {
let widget = createWidget(img)
} else {
let widget = createWidget(img)
await widget.presentMedium()
function createWidget(img) {
const widget = new ListWidget()
widget.backgroundColor =
widget.url = url
widget.backgroundImage = img
const titleText = widget.addText(getWcNameFromUrl())
titleText.font = Font.boldSystemFont(12)
titleText.textColor = Color.white()
titleText.shadowRadius = 3
titleText.shadowColor =
const subtitleText = widget.addText('')
subtitleText.font = Font.systemFont(8)
subtitleText.textColor = Color.white()
subtitleText.textOpacity = 0.8
subtitleText.shadowRadius = 3
subtitleText.shadowColor =
return widget
function getWcNameFromUrl() {
let wcName = url.split('/')
wcName = wcName[wcName.length - 2].replace('-', ' ').replace(/\b\w/g, function(c) {
return c.toUpperCase();
return wcName

This comment has been minimized.

Copy link
Owner Author

@andreasRedeker andreasRedeker commented Nov 12, 2020

Webcam Widget

View your favorite webcam from live on your iPhone homescreen!


Get Started

  1. Install the Scriptable App
  2. Copy the whole script from above
  3. Open the Scriptable App and tap „+“ in the upper right corner
  4. Paste the script, tap on "Untitled Script" on the top and type in "Webcam", then tap „Done“ in the upper left corner
  5. Go to your homescreen and long press to add a new widget
  6. Select the Scriptable widget and choose the medium-sized widget (the widget looks best in medium size)
  7. Go to, tap on a webcam and copy the link from Safari
    make sure the link looks like this:
    and not something like this:
  8. Now long press on the widget, tap „Edit Widget“, and select the „Webcam“ Script, paste the copied link into „Params“ and close the settings
  9. Finally you should see your selected webcam on your homescreen

Additional Info

  • Images are copyrighted by
  • Your mobile data usage may increase. One image is about 120kb, which sums up to several MB each day, if you don’t always have a wifi connection
  • Widget loads a new webcam image about every 10 to 20 minutes (when the screen is on and the widget is visible). This is controlled by iOS and can not be changed


Fuel Price Widget ⛽️🇩🇪

IMG_1756 (1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment