3 ms·
So that approach would be called "web scraping", and was the only way to build HN-based apps and sites before they gave us an API. Many apps still do this. The
by Uehreka 10y ago
So that approach would be called "web scraping", and was the only way to build HN-based apps and sites before they gave us an API. Many apps still do this.
The API is a little cumbersome (it's totally RESTful, which means you sometimes have to make tons of HTTP requests to get enough data for a particular view), but it's much more reliable. I don't have to worry that HN might change the structure of their markup and break my app.
(Bear in mind, that's not HN's markup on the page, it's new markup that I wrote using the data from HN's API.)