diff --git a/client/client.go b/client/client.go index c6d01cd..4d50846 100644 --- a/client/client.go +++ b/client/client.go @@ -148,3 +148,7 @@ func get(requestUrl string, variable interface{}) error { return nil } + +func ShouldSkipPost(post Post) bool { + return post.Visibility != "unlisted" && post.Visibility != "public" +} diff --git a/main.go b/main.go index 970fb59..45835c3 100644 --- a/main.go +++ b/main.go @@ -50,6 +50,10 @@ func main() { log.Println(fmt.Sprintf("Fetched %d posts", len(posts))) for _, post := range posts { + if client.ShouldSkipPost(post) { + continue + } + if err := fileWriter.Write(post); err != nil { log.Panicln("error writing post to file: %w", err) break