reddit: prevent infinite loop on error
This commit is contained in:
parent
7e69320d2c
commit
34827fe852
2 changed files with 19 additions and 8 deletions
|
@ -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"`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue