Add haikunator
This commit is contained in:
parent
38d0c1fbc3
commit
3a398a8416
@ -12,6 +12,8 @@ import irc.connection
|
|||||||
|
|
||||||
import config
|
import config
|
||||||
|
|
||||||
|
from haikunator import Haikunator
|
||||||
|
|
||||||
|
|
||||||
class Ampache2IRC(irc.bot.SingleServerIRCBot):
|
class Ampache2IRC(irc.bot.SingleServerIRCBot):
|
||||||
"""
|
"""
|
||||||
@ -39,11 +41,12 @@ class Ampache2IRC(irc.bot.SingleServerIRCBot):
|
|||||||
for entry in d.entries:
|
for entry in d.entries:
|
||||||
if(self.last_seen is None or
|
if(self.last_seen is None or
|
||||||
entry.published_parsed > self.last_seen):
|
entry.published_parsed > self.last_seen):
|
||||||
|
haikunator = Haikunator(entry.comments
|
||||||
|
.replace(config.ampache_URL, "")
|
||||||
|
.strip("/"))
|
||||||
serv.privmsg(config.channel,
|
serv.privmsg(config.channel,
|
||||||
"%s (%s)" % (entry.title,
|
"%s (%s)" % (entry.title,
|
||||||
(entry.comments
|
haikunator.haikunate(token_length=0)))
|
||||||
.replace(config.ampache_URL, "")
|
|
||||||
.strip("/"))))
|
|
||||||
self.last_seen = entry.published_parsed
|
self.last_seen = entry.published_parsed
|
||||||
|
|
||||||
def on_welcome(self, serv, ev):
|
def on_welcome(self, serv, ev):
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
feedparser==5.2.1
|
feedparser==5.2.1
|
||||||
irc==14.2.2
|
irc==14.2.2
|
||||||
|
haikunator
|
||||||
|
Loading…
Reference in New Issue
Block a user