diff options
author | Kevin Chabowski <kevin@kch42.de> | 2014-05-01 14:10:16 +0200 |
---|---|---|
committer | Kevin Chabowski <kevin@kch42.de> | 2014-05-01 14:10:16 +0200 |
commit | ac3aafafeef06bc38d1b980807786e2558edb2cb (patch) | |
tree | 57bbad5de1b19521d9c93b6ccf0b813c42fe9fff | |
parent | c57bbb8cba359a789e78cad9e267ca062740e400 (diff) | |
download | startpage-ac3aafafeef06bc38d1b980807786e2558edb2cb.tar.gz startpage-ac3aafafeef06bc38d1b980807786e2558edb2cb.tar.bz2 startpage-ac3aafafeef06bc38d1b980807786e2558edb2cb.zip |
Ignore selfposts in reddit list
-rw-r--r-- | earthporn.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/earthporn.go b/earthporn.go index ad1864a..9edb837 100644 --- a/earthporn.go +++ b/earthporn.go @@ -11,7 +11,7 @@ import ( type redditList struct { Data struct { Children []struct { - Data EarthPorn `json:"data"` + Data *EarthPorn `json:"data"` } `json:"children"` } `json:"data"` } @@ -20,6 +20,7 @@ type EarthPorn struct { Title string `json:"title"` URL string `json:"url,omitempty"` Permalink string `json:"permalink"` + Domain string `json:"domain"` } const earthPornURL = "http://www.reddit.com/r/EarthPorn.json" @@ -39,6 +40,11 @@ func GetEarthPorn() (EarthPorn, error) { for _, el := range list.Data.Children { p := el.Data + + if p.Domain == "self.EarthPorn" { + continue + } + if p.URL == "" { continue } |