shorten title if necessary
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
e1211a9f41
commit
ab6d7b1a27
|
@ -74,7 +74,14 @@ func rssItemHandler(feed *gorss.Feed, ch *gorss.Channel, newitems []*gorss.Item)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for _, ni := range newitems {
|
for _, ni := range newitems {
|
||||||
SayCh <- fmt.Sprintf("%s\n[RSS] %v - %v", *rssChannel, ni.Title, ni.Links[0].Href)
|
ti := ni.Title
|
||||||
|
if len(ti) > 80 {
|
||||||
|
runes := []rune(ti)
|
||||||
|
short := string(runes[0:80])
|
||||||
|
} else {
|
||||||
|
short := ti
|
||||||
|
}
|
||||||
|
SayCh <- fmt.Sprintf("%s\n[RSS] %v - %v", *rssChannel, short, ni.Links[0].Href)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue