diff options
author | Dimitri Sokolyuk <demon@dim13.org> | 2015-07-18 21:32:38 +0200 |
---|---|---|
committer | Dimitri Sokolyuk <demon@dim13.org> | 2015-07-18 21:32:38 +0200 |
commit | cff096060929caac895ffbfcc62a622da3c84d08 (patch) | |
tree | f8ac2acacef232f21df103af0f7bd988558f5b04 /href.go | |
parent | 2b5d3304614d6ab919a4bb623d077eaaf607b47c (diff) |
Bump title length
Diffstat (limited to 'href.go')
-rw-r--r-- | href.go | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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 |