diff options
author | Dimitri Sokolyuk <demon@dim13.org> | 2016-03-22 01:09:51 +0100 |
---|---|---|
committer | Dimitri Sokolyuk <demon@dim13.org> | 2016-03-22 01:09:51 +0100 |
commit | a3483eeb7179ea5bb9eb338655ae35447fc7839d (patch) | |
tree | abb5737f13c34e758dfdd070e9f35a9591a41a69 /href.go | |
parent | 1e8e8914e35ab721276727d38425770a6165eafa (diff) |
Cleanup
Diffstat (limited to 'href.go')
-rw-r--r-- | href.go | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -32,17 +32,13 @@ func title(n *html.Node) (s string) { func findTitle(uri string) (string, error) { client := &http.Client{} - if strings.Contains(uri, "reddit") { + if strings.Contains(uri, "reddit.com") { u, _ := url.Parse(uri) - cookies := []*http.Cookie{ - &http.Cookie{ - Name: "over18", - Value: "1", - }, - } + cookies := []*http.Cookie{&http.Cookie{Name: "over18", Value: "1"}} client.Jar, _ = cookiejar.New(nil) client.Jar.SetCookies(u, cookies) } + resp, err := client.Get(uri) if err != nil { return "", err |