January 2020
Intermediate to advanced
532 pages
13h 31m
English
First, we will create a module called HackerNewsAnalysis. The very first function is going to retrieve the top stories from Hacker News. The code for this is as follows:
using HTTPusing JSON3function fetch_top_stories() url = "https://hacker-news.firebaseio.com/v0/topstories.json" response = HTTP.request("GET", url) return JSON3.read(String(response.body))end
How does it work? Let's try it out:

Let's take several steps and dissect the logic in this function. The top stories can be retrieved from a fixed URL. Here, we have used the HTTP package for fetching data from web services. The HTTP.request function ...
Read now
Unlock full access