This lesson walks through a script that can query a Hacker News API and display the information in Script Kit.
Learn to do several things using Script Kit's global API methods, such as how to make and inspect data requests using get
and inspect
, how to display lists of data using arg
, and how to display previews of the current selection.
I feel like an idiot, but I also feel like there need to be more instructions to get up and running.
How did you create a script just by typing hackernews at the very beginning of the video?
I created a new npm project, installed the library, wrote out the same code, and I got this error:
let response = await get(`https://api.hackerwebapp.com/news`)
^
ReferenceError: get is not defined
After you installed ScriptKit, you needed to launch it either clicking on it from the tray in the top of macOS or using the shortcut which I believe by default is CMD + ;
In Scriptkit if it can't find the name of the command, hackernews
for example, it is going to ask you to create a new script and that's what it started off with. That should get you all up and running as opposed to doing it by hand through NPM.