summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2014-05-01 14:10:16 +0200
committerKevin Chabowski <kevin@kch42.de>2014-05-01 14:10:16 +0200
commitac3aafafeef06bc38d1b980807786e2558edb2cb (patch)
tree57bbad5de1b19521d9c93b6ccf0b813c42fe9fff
parentc57bbb8cba359a789e78cad9e267ca062740e400 (diff)
downloadstartpage-ac3aafafeef06bc38d1b980807786e2558edb2cb.tar.gz
startpage-ac3aafafeef06bc38d1b980807786e2558edb2cb.tar.bz2
startpage-ac3aafafeef06bc38d1b980807786e2558edb2cb.zip
Ignore selfposts in reddit list
-rw-r--r--earthporn.go8
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
}