This commit is contained in:
an 2019-08-21 18:24:26 +02:00
parent ab6d7b1a27
commit d01fbb8ce8
1 changed files with 8 additions and 7 deletions

View File

@ -75,11 +75,12 @@ func rssItemHandler(feed *gorss.Feed, ch *gorss.Channel, newitems []*gorss.Item)
} }
for _, ni := range newitems { for _, ni := range newitems {
ti := ni.Title ti := ni.Title
short := ""
if len(ti) > 80 { if len(ti) > 80 {
runes := []rune(ti) runes := []rune(ti)
short := string(runes[0:80]) short = string(runes[0:80])
} else { } else {
short := ti short = ti
} }
SayCh <- fmt.Sprintf("%s\n[RSS] %v - %v", *rssChannel, short, ni.Links[0].Href) SayCh <- fmt.Sprintf("%s\n[RSS] %v - %v", *rssChannel, short, ni.Links[0].Href)
} }