summaryrefslogtreecommitdiffstats
path: root/ircbot/contoller.py
diff options
context:
space:
mode:
Diffstat (limited to 'ircbot/contoller.py')
-rwxr-xr-xircbot/contoller.py47
1 files changed, 29 insertions, 18 deletions
diff --git a/ircbot/contoller.py b/ircbot/contoller.py
index 0b31f39c..e965da88 100755
--- a/ircbot/contoller.py
+++ b/ircbot/contoller.py
@@ -2,6 +2,35 @@ from time import sleep
import irc.bot
import _thread
import rssbot
+import os
+
+feedfile = 'new_feeds'
+url_shortener = 'http://localhost'
+
+if FEEDFILE in os.environ:
+ feedfile = os.environ['FEEDFILE']
+
+if URLSHORT in os.environ:
+ url_shortener = os.environ['URLSHORT']
+
+bots = {}
+knews = NewsBot('knews')
+
+#config file reading
+F = open(feedfile, "r")
+lines = F.readlines()
+F.close()
+
+for line in lines:
+ line = line.strip('\n')
+ linear = line.split('|')
+ bot = rssbot.RssBot(linear[1], linear[0], url_shortener)
+ bot.start()
+ bots[linear[0]] = bot
+
+knews.start()
+
+
class NewsBot(irc.bot.SingleServerIRCBot):
def __init__(self, name, server='ire', port=6667, chan='#news', timeout=60):
@@ -61,24 +90,6 @@ class NewsBot(irc.bot.SingleServerIRCBot):
except:
return "mimimimi"
-feedfile = 'new_feeds'
-
-bots = {}
-knews = NewsBot('knews')
-
-#config file reading
-F = open(feedfile, "r")
-lines = F.readlines()
-F.close()
-
-for line in lines:
- line = line.strip('\n')
- linear = line.split('|')
- bot = rssbot.RssBot(linear[1], linear[0])
- bot.start()
- bots[linear[0]] = bot
-
-knews.start()
class commands():