A
A
Andrew2019-10-28 11:48:08
PHP
Andrew, 2019-10-28 11:48:08

How to get Instagram tree comments?

Instagram API returns comments as a list without nesting. Although he himself forms a tree.
How would one build such a tree for oneself?
Comments are given like this:

Array
(
    [data] => Array
        (
            [0] => Array
                (
                    [id] => 180739851908
                    [from] => Array
                        (
                            [username] => chiaracni13
                        )

                    [text] => Масштабы застройки впечатляют...
                    [created_time] => 1572251254
                )

            [1] => Array
                (
                    [id] => 181116375771
                    [from] => Array
                        (
                            [username] => balyyuriy
                        )

                    [text] => У них нет 
                    [created_time] => 1572253754
                )

        )

    [meta] => Array
        (
            [code] => 200
        )

)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
grinat, 2019-10-28
@Slimer2

No way. There is no information in the api about the relation of the nodes to each other.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question