After installation, run this:
aws lambda add-layer-version-permission --layer-name ChromeHeadless --statement-id xaccount --action lambda:GetLayerVersion --principal "*" --version-number X --output text| // Variables used by Scriptable. | |
| // These must be at the very top of the file. Do not edit. | |
| // icon-color: deep-green; icon-glyph: cloud-upload-alt; | |
| // https://gist.github.com/schl3ck/2009e6915d10036a916a1040cbb680ac | |
| /******************************************* | |
| * * | |
| * ____ _ _ * | |
| * | _ \ | | | | * |
| async function drawArc( | |
| on, | |
| percent = 50, | |
| percent2 = -1 | |
| ) { | |
| const canvSize = 200; | |
| const canvas = new DrawContext(); | |
| canvas.opaque = false; | |
| const canvWidth = 18; // circle thickness | |
| const canvRadius = 80; // circle radius |
| console.log("Test"); | |
| class TelekomDataService { | |
| /*--- | |
| / STATIC PROPERTIES | |
| /---*/ | |
| static fileManager = FileManager.iCloud(); | |
| static scriptDir = module.filename.replace(TelekomDataService.fileManager.fileName(module.filename, true), ''); | |
| static cacheFile = TelekomDataService.fileManager.joinPath(TelekomDataService.scriptDir, "cache.json"); | |
| static historyDir = TelekomDataService.fileManager.joinPath(TelekomDataService.scriptDir, "history"); |
| // Variables used by Scriptable. | |
| // These must be at the very top of the file. Do not edit. | |
| // icon-color: purple; icon-glyph: magic; | |
| const DEBUG = false | |
| const log = DEBUG ? console.log.bind(console) : function () { }; | |
| const fontSizeBig = 12 | |
| const padding = 10 | |
| const fontSizeHuge = 36 | |
| await createDirectory() |
After installation, run this:
aws lambda add-layer-version-permission --layer-name ChromeHeadless --statement-id xaccount --action lambda:GetLayerVersion --principal "*" --version-number X --output text| // Variables used by Scriptable. | |
| // These must be at the very top of the file. Do not edit. | |
| // icon-color: pink; icon-glyph: exchange-alt; | |
| const DEBUG = false | |
| const log = DEBUG ? console.log.bind(console) : function () { }; | |
| // configure the library | |
| const libraryInfo = { | |
| name: 'TelekomDataUsageLibrary', | |
| version: '1.0.3', |
| const apiUrl = "https://pass.telekom.de/api/service/generic/v1/status" | |
| let widget = await createWidget() | |
| widget.backgroundColor = new Color("#777777") | |
| if (!config.runsInWidget) { | |
| await widget.presentSmall() | |
| } | |
| Script.setWidget(widget) | |
| Script.complete() |
| // Usage: casperjs simplytel.js <login> <password> | |
| var casper = require('casper').create({ | |
| verbose: false, | |
| logLevel: "info", | |
| exitOnError: true | |
| }); | |
| if (!casper.cli.has(0) || !casper.cli.has(1)) { | |
| casper.echo("\nUsage: casperjs simplytel.js <login> <password>").exit(); |