Latest news from MacStories

In this example included in Scriptable on Line 6 where can I get the documentation that explain the data structure (properties and methods) for the json object that it is returned. I haven’t been able to find documentation that explains jason.items, why .items? thank you

There’s no documentation for that in Scriptable since the object is not exposed by Scriptable. The JSON is loaded using await req.loadJSON() and then stored in the json variable.

When reading json.items, we read the items property in the data defined by MacStories. If you look at the JSON located at the URL ( you will notice there’s an attribute named items. That’s what we’re reading.

To get a better understanding of how the JSON object is structured, you can call QuickLook.present(json).

Side note: In this concrete case, you can refer to the spec for JSON feed. JSON feed is a format similar to Atom and RSS for exposing a feed of items. A lot of times this is news stories.

The point I was trying to make above, still stands. Since the data is loaded from a third party source, there’s no documentation of it in Scriptable. Sometimes you’ll find documentation on the third party side :blush:

1 Like

Thank you VERY much for the detailed explanation, now I fully understand it.

1 Like