This is more for a āproof of conceptā with Scriptable, but Iām so excited about this that I figured Iād post it for otherās inspiration. Itās amazing what you can accomplish with a web server and this app.
Whatās this doing?
My server is pulling in attraction wait times & park schedules via public API and formatting into JSON
Scriptable is fetching the JSON, formatting the data into tables to display in Siri, and adding voice commands to trigger these scripts
Overall it was much simpler than I expected.
I would love to be able to format the data in more ways though, like CSS styling, but beggars canāt be choosers.
Unfortunately I canāt share the URL that this script is pulling from yet. I was discussing with the developer of the themeparks API library and he said that the URLs can change frequently and in fact, Disney is in process of updating theirs now. Iām not sure how long this will work.
I plan on updating this to the āofficialā library as soon as I can because I know Iām going to get a lot of use out of this. Once I do that then Iāll post these scripts and open up my server (since I doubt itāll get that much traffic from this).
Anyway, I hope this provides some inspiration for others.
Awesome. Yea, Iām using public URLs that you can see in the master branch for that themeparks repository. The maintainer just said that theyāre āin process of changingā, so I hate to share something that might break soon.
But I have no clue what Disney has done, but their iOS app is slow and doesnāt seem to save my state at all, so every time I launch to see something itās a 15 second process it feels like.
Is the output that Siri is showing a UITable, Quick Look, Safari or some over output format? Just curious. I would like display some data in a similar fashion.
Iām looping through the returned JSON and parsing it, like:
let table = new UITable()
let header = new UITableRow()
header.isHeader = true
header.addText("Date")
header.addText("Hours")
table.addRow(header)
for (item of items) {
let row = new UITableRow()
let date = item.date
let dateCell = row.addText(date)
dateCell.widthWeight = 50
let opening = item.startTime
let closing = item.endTime
let timeCell = row.addText(opening + " ā " + closing)
timeCell.widthWeight = 50
row.height = 30
row.cellSpacing = 10
table.addRow(row)
}
QuickLook.present(table)
Sure enough, theyāve changed now. My operating hours shortcut still work, but my wait times does not anymore. Guess Iāll need to check out the Themeparks repository find where they keep there links and see how theyāve been updated