summaryrefslogtreecommitdiff
path: root/href.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-07-18 17:19:52 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-07-18 17:19:52 +0200
commit0760730678ac139632df905050726168347d6899 (patch)
treecea1ba626ee38859fa36db565471316918669f90 /href.go
parentcc7394cd10f7b8ca16676d5e1b042908a4862d86 (diff)
Drop title caching
Diffstat (limited to 'href.go')
-rw-r--r--href.go7
1 files changed, 0 insertions, 7 deletions
diff --git a/href.go b/href.go
index f661e50..d06ea40 100644
--- a/href.go
+++ b/href.go
@@ -7,8 +7,6 @@ import (
"golang.org/x/net/html"
)
-var cache = make(map[string]string)
-
func findTitle(n *html.Node) (s string) {
if n.Type == html.ElementNode && n.Data == "title" {
for c := n.FirstChild; c != nil; c = c.NextSibling {
@@ -25,10 +23,6 @@ func findTitle(n *html.Node) (s string) {
}
func FetchTitle(url string) (string, error) {
- if title, ok := cache[url]; ok {
- return title, nil
- }
-
resp, err := http.Get(url)
if err != nil {
return "", err
@@ -41,7 +35,6 @@ func FetchTitle(url string) (string, error) {
}
title := findTitle(doc)
- cache[url] = title
if len(title) > 80 {
title = title[:80] + " ..."