Fixed edge case

This commit is contained in:
2021-11-02 16:12:44 -05:00
parent 1ddbca8352
commit f9ac3ec934
3 changed files with 32 additions and 72 deletions

View File

@@ -24,6 +24,7 @@ type InstaPost struct {
Likes int `json:"likes"`
Views int `json:"views"`
URL string `json:"url"`
Type string `json:"type"`
}
//go:embed js/instagram_followers_urls.js
@@ -139,8 +140,10 @@ func (r *Runner) GetIntsaEgagement(urls []string) []InstaPost {
}
if res.Views != 0 {
res.Type = "Video"
res.Engagement = res.Views + res.Comments
} else {
res.Type = "Image"
res.Engagement = res.Likes + res.Comments
}