From 0b8a962ad08fc5c7d0f5d75855f8011750cb6b54 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 7 Jan 2014 20:27:40 +0100 Subject: ircbot: shortener url fix --- ircbot/contoller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ircbot') diff --git a/ircbot/contoller.py b/ircbot/contoller.py index 8db32b8e..26e88ca9 100755 --- a/ircbot/contoller.py +++ b/ircbot/contoller.py @@ -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: -- cgit v1.2.3 From 9d91f297622e45a79d6ed752615e635eccdc0707 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 7 Jan 2014 20:27:56 +0100 Subject: ircbot: notshorturl now in ircbot --- ircbot/rssbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ircbot') diff --git a/ircbot/rssbot.py b/ircbot/rssbot.py index 531e50c5..14126f7a 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 + '#' + entry.link.partition('://')[2].partition('/')[0]) self.oldnews.append(entry.link) self.lastnew = datetime.now() sleep(self.to) -- cgit v1.2.3 From f8279b4cfa83073890b0d819d64b49b93e96ce6e Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 7 Jan 2014 20:43:37 +0100 Subject: ircbot: fix newline in url --- ircbot/rssbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ircbot') diff --git a/ircbot/rssbot.py b/ircbot/rssbot.py index 14126f7a..5e2ca577 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 + '#' + entry.link.partition('://')[2].partition('/')[0]) + self.send(entry.title + " " + shorturl.strip('\n') + '#' + entry.link.partition('://')[2].partition('/')[0]) self.oldnews.append(entry.link) self.lastnew = datetime.now() sleep(self.to) -- cgit v1.2.3 From f5153e841834bd78808c2e6dfe4e82e64c0736c7 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 7 Jan 2014 20:51:33 +0100 Subject: ircbot: fix cr in url --- ircbot/rssbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ircbot') diff --git a/ircbot/rssbot.py b/ircbot/rssbot.py index 5e2ca577..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.strip('\n') + '#' + entry.link.partition('://')[2].partition('/')[0]) + 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) -- cgit v1.2.3 From 0d1d7d2202a0bb370d896c1c8562139fbc31b395 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 8 Jan 2014 13:03:07 +0100 Subject: ircbot: manual add now with sys url_shortener --- ircbot/contoller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ircbot') diff --git a/ircbot/contoller.py b/ircbot/contoller.py index 26e88ca9..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" -- cgit v1.2.3