summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@googlemail.com>2014-03-16 22:16:56 +0100
committerlassulus <lassulus@googlemail.com>2014-03-16 22:16:56 +0100
commitf39adfd9f57cff86813b4be4c503dda5055f02a1 (patch)
tree806bb56b783baa0f521e6d466bacbd47d09a94e8
parentcb259188f3f7c9b5c37a5b11692b5c7c5f1e146a (diff)
newsbot.py: url_shortener better abstraction
-rw-r--r--news/newsbot.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/news/newsbot.py b/news/newsbot.py
index 19ca3647..4e07d622 100644
--- a/news/newsbot.py
+++ b/news/newsbot.py
@@ -17,7 +17,7 @@ from time import sleep
## Newsbot Controller Class
class NewsBot(asybot):
- def __init__(self, name, channels=['#test'], server='ire', port=6667, timeout=60, loglevel=logging.ERROR, url_shortener='http://wall'):
+ def __init__(self, name, channels=['#test'], server='ire', port=6667, timeout=60, loglevel=logging.ERROR, url_shortener='http://localhost'):
asybot.__init__(self, server, port, name, channels, loglevel=loglevel)
self.to = timeout
self.url_shortener = url_shortener
@@ -223,12 +223,16 @@ class RssBot(asybot):
self.push('JOIN ' + chan)
self.channels.append(chan)
+ def on_welcome(self, prefix, command, params, rest):
+ asybot.on_welcome(self, prefix, command, params, rest)
+ self.push('MODE ' + self.nickname + ' +D')
+
feedfile = 'new_feeds'
-url_shortener = 'http://wall'
+url_shortener = 'http://go'
init_channels = ['#news']
bots = {}
-knews = NewsBot('knews', init_channels)
+knews = NewsBot('knews', init_channels, url_shortener=url_shortener)
#config file reading
F = open(feedfile, "r")