3 ms·
Those things should be trivial to achieve with most general purpose languages, as the API is so simple. No need for pagination or other things, just request thi
by capableweb 4y ago
Those things should be trivial to achieve with most general purpose languages, as the API is so simple. No need for pagination or other things, just request things by ID recursively and you get the full thing, then after than filter/select whatever you want.
Pseudo-code to show how simple it would be:
function get_thread(id) {
let item = http.get(`{api}/?id={id}`).body
if item.childs {
item.fetched_children = item.childs.map((id) => {
return get_thread(id)
})
}
return item
}
(untested, but you don't really need more than that, besides checking if the item was deleted)
- krapp 4y agoYes, and i've done it. But you still wind up having to make a separate request for each item, which makes building threads incredibly slow. It's also a waste of time if you're filtering out anything, because you still have to make the request and download the item to filter it out. Which is why it would be preferable for the API itself to support these features.