Skip to content

Comment on HN Greasemonkey script: Show user reputation(karma and age) in comments

Comments

Hey Michael,

that does a request to the server for every comment listed, so you are basically loading up HN with a high multiple of the current number of requests per second if this becomes popular and / or gets loaded in threads with a large number of comments.

Not sure if this is a good idea.

Well I'm sure HN gets quite a lot traffic as is at the moment on the homepage and with rss feeds and whatnot.

The user profile page itself is only around 19KB....

I'm definitely not trying to DDoS Hacker News though. If this really causes problems I will delete the repo.

Do the math, a thread with 50 comments (not rare) suddenly pulls an extra megabyte in order to retrieve several hundred bytes of info per pageview.

Anyway, it really isn't my call to make, I just figured I should warn you, in case you had not thought through the consequences of this becoming popular.

edit: unless I'm misreading your code it even does requests for users that are listed multiple times on a single page, you could easily save there by caching the results of your queries.

Maybe he can modify the script so that the score is shown only on demand.

Or memoize the fetch function. Greasemonkey has support [1] for persistent data, it should't be hard to cache the info to only fetch the counts every n comments or x days.

[1] http://diveintogreasemonkey.org/advanced/gm_getvalue.html

That sounds like a better solution. The way it is now it is very heavy.

The very best way would be to ask for stuff like this to be configurable for those that want it but HN 'feature' requests are not usually honoured.

I'm sure what the HN-specific settings are, but you are also probably going to trip the throttling functionality of news.arc (which runs HN) with this script. If you make more than N requests in M seconds, it marks your IP as a bot/script and throttles your requests after that.

If it becomes that popular it can always be added as a built-in option in hn.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.