mirror of
https://github.com/adulau/mastodon-markdown-archive.git
synced 2024-11-24 02:47:08 +00:00
Skip direct or private posts
This commit is contained in:
parent
6f6949db37
commit
ed7b62d9d2
2 changed files with 8 additions and 0 deletions
|
@ -148,3 +148,7 @@ func get(requestUrl string, variable interface{}) error {
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ShouldSkipPost(post Post) bool {
|
||||||
|
return post.Visibility != "unlisted" && post.Visibility != "public"
|
||||||
|
}
|
||||||
|
|
4
main.go
4
main.go
|
@ -50,6 +50,10 @@ func main() {
|
||||||
log.Println(fmt.Sprintf("Fetched %d posts", len(posts)))
|
log.Println(fmt.Sprintf("Fetched %d posts", len(posts)))
|
||||||
|
|
||||||
for _, post := range posts {
|
for _, post := range posts {
|
||||||
|
if client.ShouldSkipPost(post) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if err := fileWriter.Write(post); err != nil {
|
if err := fileWriter.Write(post); err != nil {
|
||||||
log.Panicln("error writing post to file: %w", err)
|
log.Panicln("error writing post to file: %w", err)
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in a new issue