Open shiimizu opened 4 years ago
@shiimizu Doesn't the following tactics work?
latestCommentId
On auto-refresh timer:
-tail.json
. If it doesn't exist, then perform a full thread refresh and go to step 5.posts[0].tail_id
is less than or equal to the current latestCommentId
.id > latestCommentId
.-tail.json
, so perform a full thread refresh.latestCommentId
and wait for the next auto-refresh.posts[0] = {
// Thread id.
"no": 185776347,
// Is "bump limit" reached?
"bumplimit": 0,
// Is "image limit" reached?
"imagelimit": 0,
// Total comments count in the thread,
// not including the "main" ("original") comment.
"replies": 195,
// Total attachments count in the thread.
"images": 82,
// Unique poster IPs count.
"unique_ips": 44,
// The length of the `posts[]` array
// (minus one for the opening post)
// in this API response.
"tail_size": 50,
// The `id` of the comment which comes before
// the first comment of the "tail".
// In other words, the `id` of the last comment
// not included in the "tail" API response.
"tail_id": 185788827
}
Document
tail_size
andtail_id
. https://github.com/4chan/4chan-API/issues/46#issuecomment-254887337From what I understand, this endpoint (
{thread-id}-tail.json
) is exclusively used by the JavaScript extension but would be a great asset to developers wanting to reduce bandwidth by knowing how & when it's emitted.Furthermore,
tail_size
seems to appear randomly in threads ({thread-id}.json
), no matter how big or small the thread. Maybe with{thread-id}-tail.json
, is there a way to reliably get a list of posts past a specifiedIf-Modified-Since
?