reddit: prevent infinite loop on error

This commit is contained in:
stefanodvx 2025-04-22 12:06:13 +02:00
parent 7e69320d2c
commit 34827fe852
2 changed files with 19 additions and 8 deletions

View file

@ -1,13 +1,19 @@
package reddit
type RedditResponse []struct {
Data struct {
Children []struct {
Data PostData `json:"data"`
} `json:"children"`
} `json:"data"`
type Child struct {
Data *PostData `json:"data"`
}
type Data struct {
Children []*Child `json:"children"`
}
type ResponseItem struct {
Data *Data `json:"data"`
}
type RedditResponse []*ResponseItem
type PostData struct {
ID string `json:"id"`
Title string `json:"title"`