Skip to content

Instantly share code, notes, and snippets.

// 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"
@gwthompson
gwthompson / spotify-now-playing.js
Created September 28, 2020 13:27 — forked from marco79cgn/spotify-now-playing.js
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")
@gwthompson
gwthompson / JapanMascots.js
Created September 28, 2020 21:51 — forked from AgustinaNahas/JapanMascots.js
Japan Mascots Scriptable Widget for iOS
// Este es un widget de Scriptable para iOS que muestra una mascota random de Japón.
// Gracias a MorettiAmye por la data! <3 https://github.com/morettiamye/yuru-chara
// This is a Scriptable Widget for iOS that shows a random mascot of Japan.
// Thank you MorettiAmye for the data! <3 https://github.com/morettiamye/yuru-chara
const mascotNumber = () => {
return Math.floor(Math.random() * (175 - 1)) + 1;
};
@gwthompson
gwthompson / scriptable-calendar-widget.md
Created September 30, 2020 17:19 — forked from rudotriton/scriptable-calendar-widget.md
Customizable iOS Calendar widget in Scriptable
@gwthompson
gwthompson / TimeZones.js
Created September 30, 2020 17:22 — forked from fcrespo82/TimeZones.js
Scriptable time zones widget
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: cyan; icon-glyph: clock;
let countries = [
{name: "🇺🇸", offset: -1, bgColor: new Color("BF0D3E",1)},
{name: "🇧🇷", offset: 0, bgColor: new Color("009639",1)},
{name: "🇮🇪", offset: 4, bgColor: new Color("FF8200",1)}
]
let widget = new ListWidget()
@gwthompson
gwthompson / Hi, Speed.js
Created October 6, 2020 18:31 — forked from simonbs/Hi, Speed.js
Greg Jowsiak's "Hi, Speed" widget recreated in Scriptable
// This script recreates Greg Joswiak's widget that counts down to the "Hi, Speed" Apple Event on October 13th, 2020.
// You can see Greg's widget in this tweet:
// https://twitter.com/gregjoz/status/1313519797879988225
//
// You'll need this image for the background:
// https://i.imgur.com/t9Jr8kL.png
//
// I've stored the image at imgs/hispeed.png Scriptable's folder in iCloud Drive.
let widget = createWidget()
@gwthompson
gwthompson / random-chuck-norris-joke.scriptable
Created October 8, 2020 13:11 — forked from sebastinez/random-chuck-norris-joke.scriptable
A random Chuck Norris Joke generator for the iOS app Scriptable
const w = new ListWidget()
w.backgroundImage = await getBgImage()
const joke = w.addText(await getJoke())
joke.textColor = Color.white()
joke.minimumScaleFactor=0.1;
joke.shadowOffset = new Point(2,2)
joke.shadowRadius = 2
joke.centerAlignText()
@gwthompson
gwthompson / aqi.js
Created October 9, 2020 18:52 — forked from jonsadka/aqi.js
Customized AQI Widget
"use strict";
/**
* This widget is from <https://github.com/jasonsnell/PurpleAir-AQI-Scriptable-Widget>
* By Jason Snell, Rob Silverii, Adam Lickel, Alexander Ogilvie, and Brian Donovan.
* Based on code by Matt Silverlock.
*/
const API_URL = "https://www.purpleair.com";
@gwthompson
gwthompson / S10桌面小组件.js
Created October 9, 2020 21:21 — forked from BlueSky-07/S11桌面小组件.js
英雄联盟 S10 x iOS 14 桌面小组件 | Scriptable
/**
* S10 桌面小组件
* Author : BlueSky
* Version : 2.0-201009
* API : https://tiyu.baidu.com/match/S10
* Gist : https://gist.github.com/BlueSky-07/70bcfedc4e5fe7fcf1b06db48124fffe
* Readme : https://sspai.com/post/62980
*/
/**
@gwthompson
gwthompson / scriptable.js
Created October 12, 2020 00:53 — forked from danielbuechele/scriptable.js
Covid Widget
const url = `https://api.coronavirus.data.gov.uk/v1/data?filters=areaName=United%2520Kingdom;areaType=overview&latestBy=newCasesByPublishDate&structure=%7B%22date%22:%22date%22,%22value%22:%22newCasesByPublishDate%22%7D`
const req = new Request(url)
const res = await req.loadJSON()
if (config.runsInWidget) {
let widget = createWidget(res.data[0].value, new Date(res.data[0].date))
Script.setWidget(widget)
Script.complete()
}