From 3a398a84161b6a59ec12cd3692252df2aa1f0184 Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Thu, 23 Jun 2016 14:35:31 +0200 Subject: [PATCH] Add haikunator --- ampache2irc.py | 9 ++++++--- requirements.txt | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ampache2irc.py b/ampache2irc.py index 2a0ab9c..51dfb09 100755 --- a/ampache2irc.py +++ b/ampache2irc.py @@ -12,6 +12,8 @@ import irc.connection import config +from haikunator import Haikunator + class Ampache2IRC(irc.bot.SingleServerIRCBot): """ @@ -39,11 +41,12 @@ class Ampache2IRC(irc.bot.SingleServerIRCBot): for entry in d.entries: if(self.last_seen is None or entry.published_parsed > self.last_seen): + haikunator = Haikunator(entry.comments + .replace(config.ampache_URL, "") + .strip("/")) serv.privmsg(config.channel, "%s (%s)" % (entry.title, - (entry.comments - .replace(config.ampache_URL, "") - .strip("/")))) + haikunator.haikunate(token_length=0))) self.last_seen = entry.published_parsed def on_welcome(self, serv, ev): diff --git a/requirements.txt b/requirements.txt index afbeee4..068a83b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ feedparser==5.2.1 irc==14.2.2 +haikunator