From 978f9030b44c2ff04623a28227bf3c806ebbf051 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Fri, 24 Jul 2015 12:57:19 +0200 Subject: Prepare for auto-fetcher --- rss.go | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/rss.go b/rss.go index b745bd6..0c42046 100644 --- a/rss.go +++ b/rss.go @@ -7,6 +7,14 @@ import ( irc "github.com/fluffle/goirc/client" ) +var Feed = map[string]string{ + "News": `https://www.linux.org.ru/section-rss.jsp?section=1`, + "Forum": `https://www.linux.org.ru/section-rss.jsp?section=2`, + "Gallery": `https://www.linux.org.ru/section-rss.jsp?section=3`, + "OpenNET": `http://www.opennet.ru/opennews/opennews_all_noadv.rss`, + "Undeadly": `http://undeadly.org/cgi?action=rss`, +} + type RSS struct{ Command } func (v RSS) Handle(conn *irc.Conn, line *irc.Line) { @@ -28,31 +36,31 @@ func init() { Register("news", &RSS{ Command{ Help: "LOR news (msg private to see all)", - Arg: `https://www.linux.org.ru/section-rss.jsp?section=1`, + Arg: Feed["News"], }, }) Register("forum", &RSS{ Command{ Help: "LOR forum (msg private to see all)", - Arg: `https://www.linux.org.ru/section-rss.jsp?section=2`, + Arg: Feed["Forum"], }, }) Register("gallery", &RSS{ Command{ Help: "LOR gallery (msg private to see all)", - Arg: `https://www.linux.org.ru/section-rss.jsp?section=3`, + Arg: Feed["Gallery"], }, }) Register("bsd", &RSS{ Command{ Help: "Undeadly news (msg private to see all)", - Arg: `http://undeadly.org/cgi?action=rss`, + Arg: Feed["Undeadly"], }, }) Register("opennet", &RSS{ Command{ Help: "OpenNET news (msg private to see all)", - Arg: `http://www.opennet.ru/opennews/opennews_all_noadv.rss`, + Arg: Feed["OpenNET"], }, }) } -- cgit v1.2.3