D
D
Dmitry2015-08-27 17:57:54
Facebook
Dmitry, 2015-08-27 17:57:54

How to get parent comment ID?

Is it possible to painlessly get the ID of the parent comment?
For example, I have a post in FB, it has a comment, and this comment has a nested one, I get all the comments via the API as an array list of all 2 comments, and when I take each of them, I don’t see which one is the parent and which nested.
The trouble is that when I want to programmatically reply to a comment, it responds well to the parent comment, but it’s impossible to reply to the nested one, since there is no deeper nesting, you need to find out the parent’s ID, and specify it when replying.
Now I take the parent, send a request, get all the nested comments, and put the parent ID in the database for all of them, but since comments can be added, they need to be constantly scanned, and if I have 10,000 comments, then this becomes just a brutal task for the script.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question