Skip to content

Instantly share code, notes, and snippets.

View rtoscani's full-sized avatar
🏎️

Renzo Toscani rtoscani

🏎️
View GitHub Profile
@rtoscani
rtoscani / scriptable-dollar-blue.js
Created January 17, 2023 19:14
Dollar Blue price widget for use on scriptable
const url = `https://api.bluelytics.com.ar/v2/latest`;
const req = new Request(url);
const res = await req.loadJSON();
const sellAmount = res.blue.value_sell;
const buyAmount = res.blue.value_buy;
const i = new Request('https://icons.iconarchive.com/icons/designcontest/ecommerce-business/256/money-icon.png');
const img = await i.loadImage();
let widget = createWidget(buyAmount, sellAmount, img);