a thoughtful web.
Good ideas and conversation. No ads, no tracking.   Login or Take a Tour!
comment by StJohn
StJohn  ·  3147 days ago  ·  link  ·    ·  parent  ·  post: Hubski prototypical API is here

I have some working code and it's waaaaay neater than the screen-scraping I was doing previously, but I don't know if I can use it regularly yet. If I want to get comments for a publication, I have to get that publication and then recursively do additional HTTP requests for each comment, each comment on those comments, etc. If I'm doing this for more than one publication, this adds up quickly to a large number of requests, which takes ages and puts a bigger load on the Hubski server.

I know you're busy, but if you get the chance my feature request would be for an end-point that lets you get a publication and all its child publications in one go. Instead of "kids" being an array of publication IDs, it would be an array of publication objects, and those child objects would have their own "kids", etc. That way you can get the whole post and all its comments in one request. This would be in addition to the existing end-point so users can choose which one they want (and not unnecessarily incur huge queries on the Hubski DB). You could call it /publication/{id}/tree or something similar.

Thanks again for the great work! I can't tell you how long I've been looking forward to this API. I make these bloody things for a living, so please let me know if I can help out at all.





rob05c  ·  3146 days ago  ·  link  ·  

Done. That endpoint will probably be renamed at some point. I don't really like 'tree,' but I haven't thought of a better name yet.

StJohn  ·  3146 days ago  ·  link  ·    ·  

Ye gods that was quick — thanks so much! I'm now happily using the new end-point and loving it. I made public all the updates to my screen-scraping plugin Static Discussion via Hubski. This plugin is designed to be used with Pelican, a static website generator, but the code is fairly basic Python and could easily be cribbed for other purposes.

I also defined all the URLs in a conf file so that the end-points can easily be updated without revving the code. If you decide on a better name than "tree", I can just redefine the end-point in the settings.

StJohn  ·  3144 days ago  ·  link  ·  

I've been ambush-badged! Thank you, insomniasexx — you move in mysterious ways.