Skip to content

Instantly share code, notes, and snippets.

// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: blue; icon-glyph: bus-alt;
// Script to show real time SL departure information using the SL real-time API https://www.trafiklab.se/node/15754/documentation
// Todo: Pass siteID and StopPointNumber as arguments
const siteID = "9001" // 9001 is T-Centralen, replace with your station's ID. See: https://www.trafiklab.se/api/sl-platsuppslag/dokumentation
const myKey = "thekey" // Replace with your key, get it from https://www.trafiklab.se/api/sl-platsuppslag
const timeWindow = "30" // Show departures in the next 30 minutes
@kunaldua
kunaldua / FootballFixtures.js
Last active November 14, 2020 20:26
Show the latest result/ upcoming fixtures of football (soccer) teams using TheSportsDB.com API
// Based almost entirely on the work of https://gist.github.com/ilyichvismara/7895bb479e14a999f3cfd2c391f10597
const teamId = 133811; // Replace this with your team's ID — find the team page on https://www.thesportsdb.com, e.g. Arsenal's page is https://www.thesportsdb.com/team/133604 so their teamID is 133604
const teamDetailUrl = "https://www.thesportsdb.com/api/v1/json/1/lookupteam.php?id=";
const leagueDetailUrl = "https://www.thesportsdb.com/api/v1/json/1/lookupleague.php?id="
const teamUrl = teamDetailUrl + teamId;
let r = new Request(teamUrl);
let teamDetail = await r.loadJSON();