Skip to content

Instantly share code, notes, and snippets.

@donfelipo
donfelipo / incidence.js
Created October 28, 2020 14:04 — forked from rphl/incidence.js
COVID-19 Inzidenz-Widget für iOS innerhalb Deutschlands 🇩🇪 (Kreis/Stadt + Bundesland + Trend)
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: red; icon-glyph: briefcase-medical;
// Licence: Robert Koch-Institut (RKI), dl-de/by-2-0
// BASE VERSION FORKED FROM AUTHOR: kevinkub https://gist.github.com/kevinkub/46caebfebc7e26be63403a7f0587f664
// UPDATED VERSION BY AUTHOR: rphl https://gist.github.com/rphl/0491c5f9cb345bf831248732374c4ef5
const outputFields = 'GEN,cases,cases_per_100k,cases7_per_100k,cases7_bl_per_100k,last_update,BL';
const apiUrl = (location) => `https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/RKI_Landkreisdaten/FeatureServer/0/query?where=1%3D1&outFields=${outputFields}&geometry=${location.longitude.toFixed(3)}%2C${location.latitude.toFixed(3)}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelWithin&returnGeometry=false&outSR=4326&f=json`
const outputFieldsStates = 'Fallzahl,LAN_ew_GEN,cases7_bl_per_100k';
@donfelipo
donfelipo / Telekom.js
Last active August 8, 2021 12:19 — forked from Sillium/telekom.js
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: pink; icon-glyph: broadcast-tower;
const apiUrl = "https://pass.telekom.de/api/service/generic/v1/status"
const tapUrl = "https://pass.telekom.de/"
const tapUrl_active = true
const cacheFileName = "scriptable-telekom.json"
const LIMIT_CRIT = 90
const LIMIT_WARN = 75
var isOnline = 0;
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-green; icon-glyph: eye;
let location = "1";
let param = args.widgetParameter;
if (param != null && param.length > 0) {
location = param;
}
// TODO embed https://www.mysports.com/nox/public/v1/studios/1225816400/utilization/v2/indicator/limits with different color scheme
@donfelipo
donfelipo / WeightDataExportTable.js
Created November 10, 2020 15:26
Scriptable weight UITable
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: teal; icon-glyph: table;
let fm = FileManager.iCloud()
let bookmarks = fm.allFileBookmarks()
let file = fm.bookmarkedPath("weight-log.json")
let content = fm.readString(file)
let json = JSON.parse(content)
let table = new UITable()
@donfelipo
donfelipo / scriptable-line-chart.js
Last active December 10, 2020 22:24 — forked from kevinkub/scriptable-line-chart.js
Simple line chart class for https://scriptable.app 📈
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: orange; icon-glyph: magic;
class LineChart {
// LineChart by https://kevinkub.de/
constructor(width, height, values) {
this.ctx = new DrawContext();
this.ctx.size = new Size(width, height);
this.values = values;