Ask PG: Polite ways to scrape HN?
Hi, I've been thinking about doing an HN related project and was wondering if the topic of crawling HN has been covered before. A search of "Ask PG" didn't bring up anything relevant nor did the guidelines and FAQ links. I'm also unaware of any api availability. There seems to be new HN side projects popping up every few weeks or so. How are you getting your HN data?
Obviously the basic rules apply, aka. don't hammer my server, duh. Assuming sequential article id's currently clocking in at ~1721000+ It would take a fare amount of time to slurp down HN even at 1k pages/day. Maybe look into pulling down the google cache. Eh, I dunno. Don't want to get any of my ip addrs banned or worse (hehe). Just looking for some guidance... Thanks in advance.
30 comments
[ 4.6 ms ] story [ 77.6 ms ] threadIt's an unofficial API though and it might not do everything you need.
http://www.paulgraham.com/rss.html
I know I'd like to see more serious attempts at vertical search engines. I wonder if getting backlash, in the form of people complaining to hosting companies, would be the hardest part of writing a search engine for ruby blog posts that understands regular expressions. I could certainly use such a tool.
He didn't say not to do it :)
http://developer.yahoo.com/yql/console/?q=select%20*%20from%...
YQL implements a bunch of caching layers so it should tread as lightly as possible.
Disclaimer: I do work for Yahoo!
Specifically we've promised a minimum of 6mo notice if we ever did decide to shut it down.
Also, could you please post final dataset somewhere when done?
You've mentioned several times that the site is on one server and that performance is an issue at times. I would donate time/money to make those problems go away, and I suspect others would as well.
Proposal: Post a new thread, "somebody build me a HN server farm", and include the software and hardware prerequisites for an Arc webserver. I bet within 48 hours you would have a 3-4 servers and a load balancer at your disposal.
You can scale anything, though. For example, a pair of reverse proxies in front of the single "share nothing" app server could reduce the load on that one machine. I'm sure the collective brilliance of the HN readership could come up with solutions.
Upgraded on 4/19/09 from a 2.4 GHz Pentium 4, 4 GB RAM, 32-bit FreeBSD 5.3.
rtm's comment: http://news.ycombinator.com/item?id=516122
Not saying pg should spend any money on this, though. A redesign of news.arc will stretch the hardware a lot further.
The only site outside of HN that uses HN data that I use regularly is ihackernews.com. All of the others I have just registered and the sites lay dormant.
It indexes HN within a few minutes of any post.