Re:Ask HN: A place like HN but with more nerdy stuff and les...
by randomdata on Saturday December 08, 2012 @12:17PM
(#4892055)
Technically, HN already exposes an API over HTTP. It just uses HTML as the exchange format instead of XML or JSON.
[ Parent
| on HN ]
Re:Ask HN: A place like HN but with more nerdy stuff and les...
by VMG on Saturday December 08, 2012 @05:36PM
(#4892939)
I try to remember that line the next time my boss wants me to code an API.
Re:Ask HN: A place like HN but with more nerdy stuff and les...
by mahmud on Sunday December 09, 2012 @01:08AM
(#4893992)
that's a shitty excuse. HTML as a "protocol" mixes presentation with content. An API should not only be presentation agnostic, but presentation free.
Re:Ask HN: A place like HN but with more nerdy stuff and les...
by randomdata on Sunday December 09, 2012 @01:55AM
(#4894090)
Where then do microformats fit, in your opinion? A defined standard for API-like transmissions, but mixed into presentable content.
Re:Ask HN: A place like HN but with more nerdy stuff and les...
by duck on Saturday December 08, 2012 @03:52PM
(#4892664)
Hmmm, not sure if I agree with that or not... but if so, it has a very limited usage quota before you get banned. :)
Re:Ask HN: A place like HN but with more nerdy stuff and les...
by sillysaurus on Saturday December 08, 2012 @04:46PM
(#4892796)
What API do you want? Automated submissions of posts is not a good idea, so that leaves data scraping.
If you're looking to extract data from HN, use HNSearch. http://www.hnsearch.com/
There's no reason to scrape data from HN itself.
Re:Ask HN: A place like HN but with more nerdy stuff and les...
by duck on Saturday December 08, 2012 @08:33PM
(#4893417)
HNSearch is great and I use it for my Wayback Letter project, but it hasn't been around that long so I couldn't use it before. When I started Hacker Newsletter about 2.5 years ago there was nothing, so scraping was the only solution. One of these days I will convert the application I built to build out each issue, but there also is a risk of HNSearch going away just like the last search engine did.
Re:Ask HN: A place like HN but with more nerdy stuff and les...
by randomdata on Saturday December 08, 2012 @08:02PM
(#4893339)
I'm curious why you disagree, aside from the quota thing? I have written many API consumers over the years and there is basically no difference between parsing HTML or any other format; XML especially, for obvious reasons.
HTML APIs to come with the added benefit of being less prone to change, which I realize goes against conventional wisdom, but seems to hold in practice.
Re:Ask HN: A place like HN but with more nerdy stuff and les...
by duck on Saturday December 08, 2012 @08:29PM
(#4893404)
I agree that parsing can be easily done, although I don't think it is necessarily equal... but I guess that would depend on a case by case basis since a lot of API's are terrible. What makes it not an API IMHO is that you can't consume it when needed, but rather you have to consume it all the time. I guess you will call that a streaming API though. :)
HTML APIs to come with the added benefit of being less prone to change
Really? I don't think that does hold in a lot of cases. Using HN as an example, it broke a year or so ago when PG changed how the job postings were listed. Again, the quality of an API can vary, but at least you would know what changed in that case.