Skip to content

Instantly share code, notes, and snippets.

@marco79cgn
marco79cgn / simpsonsWidget.js
Last active March 28, 2023 10:28
A Scriptable widget which shuffles a random Simpsons episode and plays it on Disney+ upon interaction
let openWith = args.widgetParameter
let widget = new ListWidget()
widget.setPadding(8, 10, 5, 10)
widget.backgroundColor = new Color("#111E6C")
await loadImage()
await getRandomEpisode()
Script.setWidget(widget)
Script.complete()
@marco79cgn
marco79cgn / apple-event.js
Last active September 15, 2020 20:01
Widget which opens the Apple Event Stream on YouTube
let widget = new ListWidget()
widget.setPadding(0,0,0,0)
widget.url = "https://p-events-delivery.akamaized.net/1108byjxmnoakagswdphbwatymztxxew/m3u8/main.m3u8"
widget.backgroundColor = new Color("#FFFFFF")
await loadImage("https://cdn.vertexreport.com/wp-content/uploads/2020/09/Apple-Event-September.jpg")
Script.setWidget(widget)
Script.complete()
@marco79cgn
marco79cgn / bbc1-radio.js
Created September 16, 2020 17:56
Scriptable widget that plays BBC1 radio on Sonos
let param = args.widgetParameter
let widget = new ListWidget()
widget.setPadding(0,0,0,0)
// the node sonos http api base url
let sonosBaseUrl = "http://192.168.178.10:5005"
widget.backgroundColor = new Color("#FFFFFF")
await loadImage("https://mytuner.global.ssl.fastly.net/media/tvos_radios/BFcU2vjUXh.png")
await playOnSonos()
Script.setWidget(widget)
@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
// widget created by @marco79 (Twitter) user/marco79 (RoutineHub) u/marco79 (Reddit)
// insert your Spotify client id and secret here
const clientId = "xxxxxx"
const clientSecret = "xxxxxx"
const spotifyPlaylistName = "Retrowelle Playlist"
// insert your IFTTT key and webhook url
const iftttUrl = "https://maker.ifttt.com/trigger/add_track_to_spotify/with/key/"
const iftttKey = "xxxxxx"
@marco79cgn
marco79cgn / spotify-now-playing.js
Last active May 1, 2024 20:15
A Scriptable iOS widget that shows what‘s playing on Spotify
let spotifyCredentials
let widget = await createWidget()
Script.setWidget(widget)
Script.complete()
async function createWidget() {
let widget = new ListWidget()
let spotifyIcon = await getImage("spotify-icon.png")
widget.backgroundColor = new Color("1e2040")
@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 / free-call-a-bikes.js
Last active October 9, 2020 07:30
Shows the amount of free rental bikes of my home station
// your DB Bahn Developer API token
// https://developer.deutschebahn.com/store/apis/info?name=Flinkster_API_NG&version=v1&provider=DBOpenData
const bahnApiToken = "xxx"
// the longitude and latitude of your desired station
const latitude = "50.95209"
const longitude = "6.91907"
// optional: the area uid of your desired station (for 100% accurate results)
const areaUid = ""
@marco79cgn
marco79cgn / covid-time-widget.js
Last active April 18, 2021 09:43
A Scriptable calendar widget that shows the current covid standard time
let widget = new ListWidget()
widget.setPadding(14,10,10,10)
widget.url = "https://covidstandardtime.com"
await loadCovidTime()
Script.setWidget(widget)
Script.complete()
// show a preview of the widget when run in the app, useful for testing
if(config.runsInApp) {
@marco79cgn
marco79cgn / Date & Agenda & Weather.js
Last active June 9, 2021 01:00 — forked from slowlydev/Date & Agenda & Weather.js
Date & Agenda & Weather Scriptable widget (german localization)
// this Scriptable Widget is coded by Slowlydev (aka r/Sl0wly-edits, r/Slowlydev) and adapted by @marco79
const DEV_MODE = false //for developer only
const DEV_PREVIEW = "medium" //for developer only (this script is specialy made for a medium sized widget)
const API_KEY = "" // enter your openweathermap.com api key
const FORECAST_HOURS = "3"
const UNITS = "metric" //metric for celsius and imperial for Fahrenheit
const CALENDAR_URL = "calshow://" //Apple Calendar App, if your favorite app does have a URL scheme feel free to change it