Closed Nonoleg17 closed 2 years ago
Could you be a bit more specific or show some code? What are you running exactly?
Using the Next() function, I get posts In it I check the answer(body) I attach a file with the answer (I watched Elon Musk's account) test.txt .
Turns out Instagram changed their API a bit, they don't return the comment count anymore on the feed endpoint, but added a new endpoint in the lastest commit.
Inside your for loop, add this function call:
if err := userFeed.GetCommentInfo(); err != nil {
panic(err)
}
for _, post := range userFeed.Latest() {
fmt.Printf("%d comments found\n", post.CommentInfo.CommentCount)
}
The newly added comment info struct:
type CommentInfo struct {
LikesEnabled bool `json:"comment_likes_enabled"`
ThreadingEnabled bool `json:"comment_threading_enabled"`
HasMore bool `json:"has_more_comments"`
MaxNumVisiblePreview int `json:"max_num_visible_preview_comments"`
PreviewComments []interface{} `json:"preview_comments"`
CanViewMorePreview bool `json:"can_view_more_preview_comments"`
CommentCount int `json:"comment_count"`
HideViewAllCommentEntrypoint bool `json:"hide_view_all_comment_entrypoint"`
InlineComposerDisplayCondition string `json:"inline_composer_display_condition"`
InlineComposerImpTriggerTime int `json:"inline_composer_imp_trigger_time"`
}
Let me know if this works for you
Thanks, it works.
Hi, I'm testing the collection of posts on instagram and there was a problem that there are no comments when executing func Next in media.go. Any ideas how to solve the problem?