Rename news -> rss.
This commit is contained in:
parent
3a93c6324a
commit
0674ac6d87
8
main.go
8
main.go
|
@ -19,7 +19,7 @@ import (
|
||||||
"flokatirc/version"
|
"flokatirc/version"
|
||||||
|
|
||||||
modfortune "flokatirc/modules/fortune"
|
modfortune "flokatirc/modules/fortune"
|
||||||
modnews "flokatirc/modules/news"
|
modrss "flokatirc/modules/rss"
|
||||||
modsaytime "flokatirc/modules/saytime"
|
modsaytime "flokatirc/modules/saytime"
|
||||||
modsc "flokatirc/modules/sc"
|
modsc "flokatirc/modules/sc"
|
||||||
modstoll "flokatirc/modules/stoll"
|
modstoll "flokatirc/modules/stoll"
|
||||||
|
@ -31,7 +31,7 @@ var (
|
||||||
channels = flag.String("chan", "#test", "Channels to join")
|
channels = flag.String("chan", "#test", "Channels to join")
|
||||||
nsname = flag.String("nsname", "NickServ", "NickServ name")
|
nsname = flag.String("nsname", "NickServ", "NickServ name")
|
||||||
nspass = flag.String("nspass", "", "NickServ password")
|
nspass = flag.String("nspass", "", "NickServ password")
|
||||||
modules = flag.String("modules", "news,starcitizen,fortune,saytime", "Module list, comma separated")
|
modules = flag.String("modules", "rss,starcitizen,fortune,saytime", "Module list, comma separated")
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -58,8 +58,8 @@ func main() {
|
||||||
//TODO: implement more robust list parsing
|
//TODO: implement more robust list parsing
|
||||||
|
|
||||||
//XXX: this sucks
|
//XXX: this sucks
|
||||||
if strings.Contains(*modules, "news") {
|
if strings.Contains(*modules, "rss") {
|
||||||
go modnews.Init(sayCh, "newsfeeds.conf")
|
go modrss.Init(sayCh, "newsfeeds.conf")
|
||||||
}
|
}
|
||||||
if strings.Contains(*modules, "starcitizen") {
|
if strings.Contains(*modules, "starcitizen") {
|
||||||
go modsc.Init(sayCh)
|
go modsc.Init(sayCh)
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
// and is subject to the CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
|
// and is subject to the CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
|
||||||
// license.
|
// license.
|
||||||
|
|
||||||
package news
|
package rss
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
|
@ -64,7 +64,7 @@ func itemHandler(feed *rss.Feed, ch *rss.Channel, newitems []*rss.Item) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for _, ni := range newitems {
|
for _, ni := range newitems {
|
||||||
sayCh <- fmt.Sprintf("%s\n*** [NEWS] %v - %v", "*", ni.Title, ni.Links[0].Href)
|
sayCh <- fmt.Sprintf("%s\n*** [RSS] %v - %v", "*", ni.Title, ni.Links[0].Href)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue