http://e621.net/comment/index.json?post_id=70000
Replace 70000 with whatever post ID you need, of course, and keep in mind that the last comment on the site is the first comment in that response, so flip them around to get them in the right order.
Thanks, that works.
Another question: when I specify a page number and some tags to list posts, how do I find how many pages there are?
I don't believe you can. Even e621's own pagination doesn't go past something like 100 pages, though I forget whether that is the exact upper limit. But either way, after a certain number of pages, e621 starts offering pages based on post ID instead of "page number."
Unfortunately it looks like you can't when using JSON, but you can using XML. XML's root element (posts) has a 'count' attribute, which is the total number of posts returned by the search, and an 'offset' attribute showing how many posts are before the first one (so if you requested page 2, 75 posts per page, the offset will be 75).
Here's another one (this thread just won't die!): how to get the reason a post is flagged for deletion?
Thanks for all the help btw.
ikdind said:
I don't believe you can. Even e621's own pagination doesn't go past something like 100 pages, though I forget whether that is the exact upper limit. But either way, after a certain number of pages, e621 starts offering pages based on post ID instead of "page number."
1000 pages, hard coded. at that point in time we start to hit ruby's scaling issues with pagination and gotta play magic numbers, it still works well though.
Well since this topic is almost like what I want to ask. Why doesn't Delete post that has delete because a better version has been posted comments crossover to the new version?
Falord said:
Well since this topic is almost like what I want to ask. Why doesn't Delete post that has delete because a better version has been posted comments crossover to the new version?
... I don't what... what is.. huh?
Aurali said:
... I don't what... what is.. huh?
... all I meant was the comment for deleted post go over to new posts of the same image...
Because then the comments might not make sense on the new post. If a bunch of people point out that post X is a smaller version of Y, and those comments get moved to post Y, then all of a sudden you have a bunch of comments saying that post Y is too small, which is wrong.
RenaKunisaki
Member10 months ago
API: how to get comments for a post?
In category: General
I've been working on a mobile app using the JSON API, but I've hit a snag. How do you get the comments for a post? I can get a comment by ID, but posts only have a "has_comments" field - how do I know which comment IDs correspond to which posts?