ahmdrz/goinsta

How to use Next with Sync to get latest posts in hashtags?

websines opened this issue · 0 comments

This is my code, I want to run it in an infinite loop and whenever an user makes a new post with the hashtag this function will print its ShortCode. How to use Sync() to do it?

`
func GetNewPostsFromTags() {

h := Insta.NewHashtag("hashtag")
for {
	for h.Next() {
		for i := range h.Sections {
			for _, i := range h.Sections[i].LayoutContent.Medias {
				fmt.Println(i.Item.Code)
			}
		}
	}
}

}
`