Skip to content

Instantly share code, notes, and snippets.

@marco79cgn
marco79cgn / scriptable_SolarManager_V01.js
Last active April 17, 2023 19:59
Scriptable App - Solar Manager App
/// Widget for Solar Manager Data
// read username:password from widget parameter, not hardcoded in the script
const token = args.widgetParameter
let smID = "SolarManagerID"
const gatewayData = await fetchGatewayProductionAndConsumption()
// Erstellen Sie das Widget
let widget = new ListWidget();
@marco79cgn
marco79cgn / ffp2-masks-availability.js
Last active May 14, 2023 15:21
An iOS widget for the Scriptable app which shows the availability of FFP2 masks in your local drug store (and online)
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: yellow; icon-glyph: magic;
// Maske Icon erstellt von "Freepik" (www.flaticon.com/de)
let country = "de";
let storeId = 251;
let param = args.widgetParameter;
if (param != null && param.length > 0) {
@marco79cgn
marco79cgn / charging-points-capacity.js
Last active June 23, 2023 17:47
iOS widget, das die Anzahl sowie den Anteil der aktuell belegten Ladepunkte in Deutschland zeigt.
const canvSize = 200;
const canvTextSize = 80;
const canvas = new DrawContext();
canvas.opaque = false;
const battCircleRemainColor = new Color("#32CD33"); // Charge circle remaining color
const battCircleDepletedColor = new Color("#fff");
const battCircleBGColor = new Color('#fff'); // Widget background color
const battCircleTextColor = new Color('#000'); // Widget text color
const labelColor = new Color('#768178')
const textColor = new Color('#34443c')
@marco79cgn
marco79cgn / spotify-whats-new.js
Created October 2, 2020 14:42
A Scriptable widget that shows what's new on Spotify
// insert your Spotify client id and secret here
const clientId = "xxx"
const clientSecret = "xxx"
// the Spotify country ISO code
const spotifyCountry = "DE"
let widget = await createWidget()
Script.setWidget(widget)
Script.complete()
@marco79cgn
marco79cgn / bbc2-playlist.js
Last active August 28, 2023 21:02
A custom iOS widget that shows the last 5 songs from BBC2 radio and plays them in Spotify (for Scriptable.app)
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: red; icon-glyph: music;
// insert your Spotify client id and secret here
const clientId = "xxx"
const clientSecret = "xxx"
let widget = new ListWidget()
widget.setPadding(22,10,10,10)
@marco79cgn
marco79cgn / apple-availability-check.sh
Last active September 24, 2023 11:25
Bash script that checks whether an Apple product is available for pickup at your nearest Apple Store and sends a push notification if it gets available again (via ntfy.sh)
#!/bin/bash
partNo=$1
storeId=$2
notifyUrl=https://ntfy.sh/$3
FILE=$4/${partNo/\//-}-$storeId
if [ ! -f "$FILE" ]; then
echo "$FILE does not exist."
echo -n "1" > $FILE
fi
@marco79cgn
marco79cgn / ard-mediathek.js
Last active October 1, 2023 18:28
A custom widget showing editors picks of the ARD Mediathek for scriptable.app
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-blue; icon-glyph: film;
// name: ard-mediathek.js
// description: A scriptable widget which displays the latest editorial picks of the ARD Mediathek
// author: Marco Dengel
// email: marco79cgn@gmail.com
let mediathekData;
@marco79cgn
marco79cgn / swr1-bw-top1000.js
Last active October 23, 2023 14:37
A Scriptable iOS widget that shows the last 5 positions of the SWR1 Top 1000 charts
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: red; icon-glyph: newspaper;
// insert your Spotify client id and secret here (replace xxx)
const clientId = "xxx"
const clientSecret = "xxx"
let widget = new ListWidget()
widget.setPadding(22, 10, 10, 10)
@marco79cgn
marco79cgn / apple-product-availability.js
Last active November 8, 2023 07:28
Custom iOS widget that shows both the store and online availability of a given product (for Scriptable.app)
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: blue; icon-glyph: magic;
// default zip and partNo - will be overwritten by your widget parameters
let zip = '50670'
let partNo = "MU7A3ZD/A"
// insert your ntfy url
const notifyUrl = "https://ntfy.sh/******"
// force push notification - set to true in order to test that your setup is working correctly
const forcePushNotification = false
@marco79cgn
marco79cgn / sonos-nowPlaying.js
Last active January 6, 2024 07:46
A scriptable widget that shows what's playing on SONOS
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: cyan; icon-glyph: magic;
// the node sonos http api base url (running on your Pi for example)
let sonosBaseUrl = "http://192.168.178.10:5005"
// optional for cover art: the ip address of one of your Sonos speakers
let sonosPlayerUrl = "http://192.168.178.38:1400"
let param = args.widgetParameter