4 ms·
Scraping HN and building, say, a JSON blob out of a thread page wouldn't be difficult - if I can do it with curl and PHP then anybody can do it. My biggest conc
by krapp 12y ago
Scraping HN and building, say, a JSON blob out of a thread page wouldn't be difficult - if I can do it with curl and PHP then anybody can do it. My biggest concern though would be how HN itself would react to that - and of course if you want it to be more than read-only and completely seamless you have to do what essentially amounts to cross-site request forgery to make it appear the login and posting is being done on your site and not the other - and it looks like HN uses a csrf token in the form.
So probably the least painful way of doing it (apart from an official JSON API) would be to scrape the site periodically (not so quickly as to be banned, obviously) or use one of the existing services which acts as a proxy api, save locally to your own backend and then do whatever.
Personally though, I think it's slightly unethical, unless you're going to clearly mention that the content is coming from HN and you have their permission. What do they get out of you using their resources to lead readers away from their site, after all?
- Turing_Machine 12y agoThere might also be some copyright issues. When you post a comment on HN you're implicitly giving HN permission to display the comment on HN, but not necessarily granting permission to redisplay the comment on other sites of which you might not even be aware. Godwinized example: most of us wouldn't want our names and comments displayed on, say, a Nazi site, especially if it looked like the comments were being posted directly on that site rather than being copied from somewhere else.