summaryrefslogtreecommitdiff
path: root/href.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-03-22 01:09:51 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-03-22 01:09:51 +0100
commita3483eeb7179ea5bb9eb338655ae35447fc7839d (patch)
treeabb5737f13c34e758dfdd070e9f35a9591a41a69 /href.go
parent1e8e8914e35ab721276727d38425770a6165eafa (diff)
Cleanup
Diffstat (limited to 'href.go')
-rw-r--r--href.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/href.go b/href.go
index 3f25700..0e855a7 100644
--- a/href.go
+++ b/href.go
@@ -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