nborrmann / jodel_api

Unoffical Python Interface to the Jodel API
MIT License
149 stars 33 forks source link

Post Details - How does reply-paging work? #54

Closed megaguru closed 6 years ago

megaguru commented 6 years ago

As the v2 endpoint for post details finally stopped working (cf. #53 ), I need to change a couple of things.

I have tried to get all replies to a Jodel that has more than 50 answers with the get_post_details_v3 method. According to the (herein) exposed API, I am supposed to use the skip parameter for later posts - but regardless of what I am putting into there, I only get the very same set of replies. Sometimes it sort of seemed to work, but the remaining number never ended up becoming 0 - and I am not actually able to reconstruct these cases.

Unfortunately, the testcases do not show how to use this parameter correctly either. Taking another look into the cfib90/OJOC implementation reveals pretty much the same. However, there it is said that the v3 endpoint sometimes does use weird timestamps for paging: link. No success with such approaches until now either.

Does anyone have a good understanding how to use the new endpoint correctly to catch all replies to a single post and can help me out e.g. with a simple example?

Many thanks in advance.

nborrmann commented 6 years ago

The reply of get_post_details_v3 has a parameter next. This is what you have to plug into the next parameter. It's true that this parameter is kinda weird and switches between timestamps and post_ids (or numbers? I can't remember). But just stupidly using that value in the next works pretty reliably for me.

megaguru commented 6 years ago

Ah, that answers my question. Big thanks!