Write a Script with Script Kit to Browse Hacker News

InstructorJohn Lindquist

Share this video with your friends

Send Tweet

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.

Install Hacker News Script

~ 3 years ago

I feel like an idiot, but I also feel like there need to be more instructions to get up and running.

  1. How did you create a script just by typing hackernews at the very beginning of the video?

  2. 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
Prince Wilson
~ 3 years ago

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.