Skip to content

Instantly share code, notes, and snippets.

@marco79cgn
marco79cgn / ard-plus-dl.sh
Last active February 29, 2024 20:54
Das Skript lädt entweder einen einzelnen Film, Staffeln einer Serie oder alle Tatort Folgen einer Stadt von ARD Plus
#!/bin/bash
FILE=ard-plus-token
# parse input parameter
ardPlusUrl=$1
username=$2
password=$3
skip=$4
movieId=''
token=''
showPath=$(echo $ardPlusUrl | rev | cut -d "/" -f1 | rev)
@marco79cgn
marco79cgn / radioeins-widget.js
Last active February 21, 2024 03:26
A scriptable iOS widget which displays the program and recent songs of "radioeins vom rbb"
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: orange; icon-glyph: volume-up;
// name: radioeins-widget.js
// description: A scriptable widget which displays the program and recent songs of radioeins vom rbb
// author: Marco Dengel
// email: marco79cgn@gmail.com
// Insert your Spotify credentials here!
@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 / 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 / smart-1-availability.js
Last active February 16, 2024 09:53
iOS Widget für die Scriptable App, das den aktuellen Bestand von Smart #1 und #3 Fahrzeugen anzeigt
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: blue; icon-glyph: car-alt;
let productId = 'HC1H2D3B61EU011295' // Produktnummer des gewünschten Fahrzeugs
let param = args.widgetParameter
if (param != null && param.length > 0) {
productId = param
}
const carImageFileName = productId + ".png"
@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 / adele-30-countdown.js
Last active April 21, 2022 04:07
A scriptable widget that counts down the days until the new Adele album "30" is released and plays her latest single until then
// Once you tap the widget, it plays her new single "Easy on me" on YouTube (default).
// You can configure "apple" or "spotify" as widget parameter
// to open the song in the corresponding app
const PARAM = args.widgetParameter
const DATE = "2021-11-19T08:00:00Z"
const BG_IMG_URL = "https://i.imgur.com/CycspeY.jpg"
const YOUTUBE_LINK = "https://www.youtube.com/watch?v=U3ASj1L6_sY"
const SPOTIFY_SONG_LINK = "https://open.spotify.com/track/0gplL1WMoJ6iYaPgMCL0gX?si=ea4b8de949d042dc"
const APPLE_ALBUM_LINK = "https://music.apple.com/de/album/30/1590035691"
@marco79cgn
marco79cgn / schnelltest-availability.js
Last active December 15, 2021 22:55
Shows the available amount of Covid Tests in your local drug store and online
let country = "de"; // replace with 'at' for shops in Austria
let storeId = 251;
let param = args.widgetParameter;
if (param != null && param.length > 0) {
if (param.indexOf(";") > 0) {
const paramSplit = param.split(";");
storeId = paramSplit[0];
country = paramSplit[1].toLowerCase();
} else {
storeId = param;
@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 / vaccination-stats.js
Last active January 11, 2023 21:47
A Scriptable widget that shows the amount of people who have received the corona vaccination in Germany
// Version 1.3.0
// 27.11.2021
//
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: red; icon-glyph: notes-medical;
// Mit Caching und Fallback
const cacheMinutes = 60; // 60 min
const today = new Date();
const neededTotalVaccinations = 83200000;