Skip to content

Instantly share code, notes, and snippets.

@liopoos
Last active December 29, 2020 08:42
Show Gist options
  • Save liopoos/ab1fed414c4c1ff7d0dd6370c4f46d10 to your computer and use it in GitHub Desktop.
Save liopoos/ab1fed414c4c1ff7d0dd6370c4f46d10 to your computer and use it in GitHub Desktop.
Apple Store Code By Scriptable
// 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