Skip to content

Instantly share code, notes, and snippets.

@marco79cgn
marco79cgn / smart-1-availability.js
Last active February 8, 2023 12:49
iOS Widget für die Scriptable App, das den aktuellen Bestand von Smart #1 Fahrzeugen anzeigt
View smart-1-availability.js
// 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 = 'HX1ESD2A51EU010191' // Produktnummer des gewünschten Fahrzeugs
let param = args.widgetParameter
if (param != null && param.length > 0) {
productId = param
}
const carImageFileName = productId + ".png"
@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
View adele-30-countdown.js
// 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
View schnelltest-availability.js
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 December 12, 2021 22:08
An iOS widget for the Scriptable app which shows the availability of FFP2 masks in your local drug store (and online)
View ffp2-masks-availability.js
// 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
View vaccination-stats.js
// 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;
@marco79cgn
marco79cgn / bbc2-playlist.js
Last active September 28, 2022 12:02
A custom iOS widget that shows the last 5 songs from BBC2 radio and plays them in Spotify (for Scriptable.app)
View bbc2-playlist.js
// 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-product-availability.js
Last active October 13, 2022 08:21
Custom iOS widget that shows both the store and online availability of a given product (for Scriptable.app)
View apple-product-availability.js
let params = getParams(args.widgetParameter)
const shopAvailability = await getShopAvailability()
const onlineAvailability = await getOnlineAvailability()
let widget = new ListWidget()
widget.setPadding(0, 8, 6, 8)
let appleText = widget.addText("")
appleText.centerAlignText()
appleText.font = Font.boldMonospacedSystemFont(24)
@marco79cgn
marco79cgn / ard-mediathek.js
Last active March 8, 2021 10:21
A custom widget showing editors picks of the ARD Mediathek for scriptable.app
View ard-mediathek.js
// 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 / wach-und-wichtig.js
Last active March 3, 2021 08:38
iOS widget, das die neueste Folge des radioeins Podcasts "Wach & Wichtig" anzeigt und abspielt (für die Scriptable.app)
View wach-und-wichtig.js
// Wach und Wichtig Podcast Widget
//
// Copyright (C) 2020 by marco79 <marco79cgn@gmail.com>
//
// Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
// IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
@marco79cgn
marco79cgn / dm-toilet-paper-wheat-flour.js
Last active October 15, 2022 12:13
iOS Widget, das die Anzahl an Klopapier und Mehl Packungen in deiner nächsten dm Drogerie anzeigt (für die scriptable.app)
View dm-toilet-paper-wheat-flour.js
// dm Klopapier & Mehl Widget
//
// Copyright (C) 2020 by marco79 <marco79cgn@gmail.com>
//
// Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
// IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE