summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@googlemail.com>2014-01-09 19:04:03 +0100
committerlassulus <lassulus@googlemail.com>2014-01-09 19:04:03 +0100
commit1b3abcd0e37f2c3730ab05062f6b0275429a3522 (patch)
treee6a578c8d65e1849e09e1843d8bb5351e7c3bb0c
parentf1491bbc2003de22d5436d8fea0ce6eb80db8dd3 (diff)
ircbot: search command
-rwxr-xr-xircbot/contoller.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/ircbot/contoller.py b/ircbot/contoller.py
index bf4dd578..59c3abb8 100755
--- a/ircbot/contoller.py
+++ b/ircbot/contoller.py
@@ -3,8 +3,7 @@ import irc.bot
import _thread
import rssbot
import os
-
-
+import subprocess
class NewsBot(irc.bot.SingleServerIRCBot):
def __init__(self, name, chans=['#news'], server='ire', port=6667, timeout=60):
@@ -27,15 +26,10 @@ class NewsBot(irc.bot.SingleServerIRCBot):
self.connection.privmsg(target, line)
sleep(1)
- def sendq(self, target, string):
- for line in string.split('\n'):
- self.connection.privmsg(target, line)
- sleep(1)
-
def on_privmsg(self, connection, event):
args_array = event.arguments[0].split()
answer = self.read_message(args_array)
- self.sendq(event.source.nick, answer)
+ self.send(event.source.nick, answer)
def on_pubmsg(self, connection, event):
args_array = event.arguments[0].split()
@@ -115,6 +109,9 @@ class commands():
else:
return 'bot not found'
+ def search(args):
+ output = subprocess.check_output(['./GfindFeeds4bot', args[1]]).decode()
+ return output
feedfile = 'new_feeds'
url_shortener = 'http://wall'