Okay, here is the problem:
Certain questions contain more than one page's worth of answers. Given a sort method and an answer id, how can we figure out which page the answer is on?
Any suggestions are welcome.
|
|
These are two simple methods in meta-language: 1. Pulls a pagesize number of answers, page after page, checking the presence of the given accepted_answer_id
2. Pulls all the answers ids using the fastest/lightest API method (questions/id/answers, pagesize=100, body=false..), get the index of the accepted_answer_id on this list and finally find the page dividing accepted_answer_id position by the pagesize
My 0.02c |
|||
|
|
|
Why go through the question to get an answer you already have? You have an answer id, so you can get all of its information. |
|||||||
|
|
I suppose you could pull all answers from a question and store them in a list is a static sorted order. Then, you would know the page the answer is on given the entire list. It is far less memory efficient, but it will be much easier to figure out. |
|||
|
|