summaryrefslogtreecommitdiffstats
path: root/ircbot
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2014-01-08 15:24:51 +0100
committermakefu <github@syntax-fehler.de>2014-01-08 15:24:51 +0100
commitd8764b3327cfe772965b3f4a947071159a1d6161 (patch)
tree7f9866c5760ddb0e55322b2e59f7895b265d616e /ircbot
parent64420ecb20bc7616bacfdca7788dc2d517ea8600 (diff)
parent0d1d7d2202a0bb370d896c1c8562139fbc31b395 (diff)
Merge branch 'master' of ssh://github.com/krebscode/painload
Diffstat (limited to 'ircbot')
-rwxr-xr-xircbot/contoller.py4
-rwxr-xr-xircbot/rssbot.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/ircbot/contoller.py b/ircbot/contoller.py
index 8db32b8e..1d9347c3 100755
--- a/ircbot/contoller.py
+++ b/ircbot/contoller.py
@@ -61,7 +61,7 @@ class NewsBot(irc.bot.SingleServerIRCBot):
class commands():
def add(args):
- bot = rssbot.RssBot(args[2], args[1])
+ bot = rssbot.RssBot(args[2], args[1], url_shortener=url_shortener)
bots[args[1]] = bot
bot.start()
return "bot " + args[1] + " added"
@@ -118,7 +118,7 @@ class commands():
feedfile = 'new_feeds'
-url_shortener = 'http://localhost:1337'
+url_shortener = 'http://wall'
init_channels = ['#news']
if 'FEEDFILE' in os.environ:
diff --git a/ircbot/rssbot.py b/ircbot/rssbot.py
index 531e50c5..225e6f13 100755
--- a/ircbot/rssbot.py
+++ b/ircbot/rssbot.py
@@ -58,7 +58,7 @@ class RssBot(irc.bot.SingleServerIRCBot):
# self.send(entry.title + " " + entry.link + " com: " + entry.comments)
#except AttributeError:
shorturl = subprocess.check_output(["curl", "-sS", "-F", "uri=" + entry.link, self.url_shortener]).decode()
- self.send(entry.title + " " + shorturl)
+ self.send(entry.title + " " + shorturl.strip('\n').strip('\r') + '#' + entry.link.partition('://')[2].partition('/')[0])
self.oldnews.append(entry.link)
self.lastnew = datetime.now()
sleep(self.to)