News for hackers. Stuff that matters.
Re:Hn-api: a simple, ad-hoc Python API for Hacker News by scottjackson on Tuesday February 09, 2010 @09:34AM (#1112243)
I hear you -- in fact, I think I'll put something in the readme about that.
Re:Hn-api: a simple, ad-hoc Python API for Hacker News by jacquesm on Tuesday February 09, 2010 @09:36AM (#1112248)
Re:Hn-api: a simple, ad-hoc Python API for Hacker News by scottjackson on Tuesday February 09, 2010 @09:45AM (#1112267)
Thanks for the link.

hn-api only makes one request when it gets stories or one request when you get a user's karma -- that doesn't seem like too much. I knew there was a velocity check on IPs (and that I was making an unofficial API), so I made it as light on HN as possible.

Re:Hn-api: a simple, ad-hoc Python API for Hacker News by jacquesm on Tuesday February 09, 2010 @09:51AM (#1112279)
Can't you cache the users state ? It's not like you need karma updates every time you do a request to the API.
Re:Hn-api: a simple, ad-hoc Python API for Hacker News by scottjackson on Tuesday February 09, 2010 @10:02AM (#1112303)
> It's not like you need karma updates every time you do a request to the API.

Obviously.

When a request is made to get stories from HN, no HackerNewsUser objects are created (and thus, no karma gets updated). hn-api will only update karma when you, the coder, make a HackerNewsUser object or call the HackerNewsUser.refreshKarma() method.

Like I said -- one request when it gets stories or one request when you get a user's karma.

Re:Hn-api: a simple, ad-hoc Python API for Hacker News by jacquesm on Tuesday February 09, 2010 @10:19AM (#1112339)
I get that, I meant cached as in persistent across runs :)

Then you can specify some kind of time-out (say 3 days or so), after which it does get refreshed.

Re:Hn-api: a simple, ad-hoc Python API for Hacker News by scottjackson on Tuesday February 09, 2010 @10:36AM (#1112387)
Oh, sorry. I didn't even think of that :)

I'll look into it. Or, if some intrepid volunteer would like to contribute to the project, maybe they could.