Last active
December 29, 2020 08:42
-
-
Save liopoos/ab1fed414c4c1ff7d0dd6370c4f46d10 to your computer and use it in GitHub Desktop.
Apple Store Code By Scriptable
This file contains hidden or 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: orange; icon-glyph: apple-alt; | |
let stores = await getStoreList() | |
let table = new UITable() | |
for(let i in stores) { | |
let row = new UITableRow() | |
let store = stores[i] | |
row.addText(store.storeName, store.city) | |
let number = UITableCell.text(store.storeNumber) | |
number.rightAligned() | |
row.addCell(number) | |
row.cellSpacing = 6 | |
table.addRow(row) | |
} | |
QuickLook.present(table) | |
async function getStoreList() { | |
let url = "https://reserve-prime.apple.com/CN/zh_CN/reserve/A/stores.json" | |
let stores = await new Request(url).loadJSON() | |
return stores.stores | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment