This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Variables used by Scriptable. | |
// These must be at the very top of the file. Do not edit. | |
// icon-color: pink; icon-glyph: file-import; | |
let fm = FileManager.iCloud() | |
let bookmarkName = "Shortcut Links" | |
let filePath = fm.bookmarkedPath(bookmarkName) | |
let contents = fm.readString(filePath) | |
let links = contents.split("\n") | |
importLinks(links) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Variables used by Scriptable. | |
// These must be at the very top of the file. Do not edit. | |
// icon-color: deep-blue; icon-glyph: file-signature; | |
let text = args.shortcutParameter | |
let fm = FileManager.iCloud() | |
let filePath = args.fileURLs[0] | |
let content = fm.readString(filePath) | |
let newText = content + "\n" + text | |
fm.writeString(filePath, newText) | |
Script.complete() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let tag = args.shortcutParameter | |
let fm = FileManager.iCloud() | |
let filePath = args.fileURLs[0] | |
fm.removeTag(filePath, tag) | |
let tags = fm.allTags(filePath) | |
let output = {"tags": tags} | |
Script.setShortcutOutput(output) | |
Script.complete() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let tag = args.shortcutParameter | |
let fm = FileManager.iCloud() | |
let filePath = args.fileURLs[0] | |
fm.addTag(filePath, tag) | |
let tags = fm.allTags(filePath) | |
let output = {"tags": tags} | |
Script.setShortcutOutput(output) | |
Script.complete() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You must generate and insert your own API key for Google Maps + Directions JS SDK. | |
// The script uses Google Maps to display the scooters on a map as well as the route to the nearest scooter. Follow the guide on the link below to obtain an API key. | |
// https://developers.google.com/maps/documentation/javascript/get-api-key | |
let googleApiKey = "" | |
// Choose the enabled rental companies. Set to true to enable the rental company and false to disable it. | |
let COMPANIES = { | |
bird: true, | |
lime: true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let windowStart = new Date() | |
let windowEnd = new Date() | |
windowStart.setHours(19) | |
windowStart.setMinutes(00) | |
windowStart.setSeconds(00) | |
windowEnd.setHours(21) | |
windowEnd.setMinutes(30) | |
windowEnd.setSeconds(00) | |
let channelIds = [ | |
"1", // DR1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let date = new Date() | |
let y = ""+date.getFullYear() | |
let m = ""+(date.getMonth() + 1) | |
let d = ""+date.getDate() | |
let dateStr = y+"-"+zeroPrefix(m)+"-"+zeroPrefix(d) | |
let siriArgs = args.siriShortcutArguments | |
let channelId = siriArgs.channel | |
let channelIds = [] | |
if (channelId != null) { | |
channelIds = [channelId] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Variables used by Scriptable. | |
// These must be at the very top of the file. Do not edit. | |
// icon-color: brown; icon-glyph: file-code; | |
// To use this script, you need to configure an OAuth App on GitHub. | |
// Follow the instructions on the link below to create your OAuth App. | |
// | |
// When you are asked to put in a redirect URL, you should put the URL for running this script in Scriptable. Assuming the name of this script is "Create Gist", the URL is scriptable:///run?scriptName=Create%20Gist | |
// | |
// https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/ | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let url = "https://sports-data.api.tv2.dk/sports-data-backend/cycling/stages/1720933/standings" | |
let req = new Request(url) | |
req.headers = { "Accept": "application/json" } | |
let json = await req.loadJSON() | |
let rawStandings = json["cyclingGeneralStandings"] | |
let standings = rawStandings.map(mapStanding) | |
let table = formatStandings(standings) | |
QuickLook.present(table) | |
if (config.runsWithSiri) { | |
let tts = siriText(standings) |