summaryrefslogtreecommitdiff
path: root/href.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-07-18 21:32:38 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-07-18 21:32:38 +0200
commitcff096060929caac895ffbfcc62a622da3c84d08 (patch)
treef8ac2acacef232f21df103af0f7bd988558f5b04 /href.go
parent2b5d3304614d6ab919a4bb623d077eaaf607b47c (diff)
Bump title length
Diffstat (limited to 'href.go')
-rw-r--r--href.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/href.go b/href.go
index 6dc72d9..2a634c2 100644
--- a/href.go
+++ b/href.go
@@ -13,7 +13,10 @@ var (
tooBig = errors.New("cotent too big")
)
-const MB = 1024 * 1024
+const (
+ MB = 1024 * 1024
+ maxLen = 160
+)
func findTitle(n *html.Node) (s string) {
if n.Type == html.ElementNode && n.Data == "title" {
@@ -53,8 +56,8 @@ func FetchTitle(url string) (string, error) {
title := findTitle(doc)
- if len(title) > 80 {
- title = title[:80] + " ..."
+ if len(title) > maxLen {
+ title = title[:maxLen] + " ..."
}
return title, nil